C Function Declaration and Prototypes Quiz
3 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which of the following is a valid way to declare a function in C?

  • function sum(int a, int b) { return a + b; }
  • int sum(int a, int b) { return a + b; } (correct)
  • def sum(a, b): return a + b
  • int sum(a, b) { return a + b; }
  • What does the 'void' keyword indicate in a C function declaration?

  • The function takes no parameters
  • The function returns a void pointer
  • The function returns an integer value
  • The function does not return any value (correct)
  • Which of the following is true about function prototypes in C?

  • They are only used in object-oriented programming
  • They are not required in C programs
  • They declare the function before its actual definition (correct)
  • They are placed at the end of the program
  • More Like This

    Master MATLAB Function Declaration
    10 questions
    C Programming Function Declaration
    10 questions
    Programowanie w C - Funkcje i Wskaźniki
    16 questions
    Use Quizgecko on...
    Browser
    Browser