Function MCQs
Practice free Function multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 223 questions — no login required.
Question 37easy
What is the result of compiling and running this code?
main()
{
char string[] = "Hello World";
display(string);
}
void display(char *string)
{
printf("%s", string);
}Question 38easy
Determine output:
main()
{
int i = 5;
printf("%d%d%d%d%d", i++, i--, ++i, --i, i);
}Question 39easy
Pick the correct statements. I. The body of a function should have only one return statement. II. The body of a function may have many return statements. III. A function can return only one value to the calling environment. IV. If return statement is omitted, then the function does its job but returns no value to the calling environment.
Advertisement
Question 40easy
What will be the output of the following program code?
main()
{
static int var = 5;
printf("%d ", var--);
if(var)
main();
}Question 41easy
Which of the following is a complete function?
Question 42easy
What will be printed when this program is executed?
int f(int x)
{
if(x <= 4)
return x;
return f(--x);
}
void main()
{
printf("%d ", f(7));
}Advertisement
Question 43easy
The recursive functions are executed in a ...........
Question 44easy
The function scanf() returns .........
Question 45easy
Functions have ..........