Podcast
Questions and Answers
Which of the following is a valid way to declare a function in C?
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?
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?
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