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 199easy
What will be the output of the following C code?
#include <stdio.h>
#include "printf"
void main()
{
printf("hello");
}Question 200easy
Can variable i be accessed by functions in another source file?
#include <stdio.h>
int i;
int main()
{
printf("%d\n", i);
}Question 201easy
What will be the output of the following C code?
#include <stdio.h>
static int x = 5;
void main()
{
x = 9;
{
int x = 4;
}
printf("%d", x);
}Advertisement
Question 202easy
What will be the output of the following C code?
#include <stdio.h>
void m(int k)
{
printf("hi");
}
void m(double k)
{
printf("hello");
}
void main()
{
m(3);
}Question 203easy
Automatic variables are allocated memory in . . . . . . . .
Question 204easy
What will be the output of the following C code?
#include <stdio.h>
void f();
int main()
{
#define max 10
f();
return 0;
}
void f()
{
printf("%d\n", max * 10);
}Advertisement
Question 205easy
Which of the following is true for the static variable?
Question 206easy
What will be the data type returned for the following C function?
#include <stdio.h>
int func()
{
return (double)(char)5.0;
}Question 207easy
What will be the output of the following C code?
#include <stdio.h>
void main()
{
static int x = 3;
x++;
if (x <= 5)
{
printf("hi");
main();
}
}