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 46easy
Which of the following function calculates the square of 'x' in C?
Question 47easy
When a function is recursively called all the automatic variables are stored in a ..........
Question 48easy
char* myfunc(char *ptr)
{
ptr+=3;
return(ptr);
}
void main()
{
char *x, *y;
x = "EXAMVEDA";
y = myfunc(x);
printf("y=%s", y);
}What will be printed when the sample code above is executed?
Advertisement
Question 49easy
What will be the output of the following C code?
#include <stdio.h>
#define foo(x, y) #x #y
int main()
{
printf("%s\n", foo(k, l));
return 0;
}Question 50easy
What will be the output of the following C code?
#include <stdio.h>
double var = 8;
int main()
{
int var = 5;
printf("%d", var);
}Question 51easy
What will be the output of the following C code?
#include <stdio.h>
int x = 5;
void main()
{
int x = 3;
printf("%d", x);
{
x = 4;
}
printf("%d", x);
}Advertisement
Question 52easy
Which part of the program address space is p stored in the following C code?
#include <stdio.h>
int *p = NULL;
int main()
{
int i = 0;
p = &i
return 0;
}Question 53easy
What would happen if you create a file stdio.h and use #include "stdio.h"?
Question 54easy
What will be the output of the following C code?
#include <stdio.h>
int x;
void main()
{
printf("%d", x);
}