Select an option to see the answer and solution.
Function
practice.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
223
Questions
3/12
Page
Pick an option on a question to see the right answer and solution.
int f(int x)
{
if(x <= 4)
return x;
return f(--x);
}
void main()
{
printf("%d ", f(7));
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
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?
Select an option to see the answer and solution.
#include <stdio.h>
#define foo(x, y) #x #y
int main()
{
printf("%s\n", foo(k, l));
return 0;
}Select an option to see the answer and solution.
#include <stdio.h>
double var = 8;
int main()
{
int var = 5;
printf("%d", var);
}Select an option to see the answer and solution.
#include <stdio.h>
int x = 5;
void main()
{
int x = 3;
printf("%d", x);
{
x = 4;
}
printf("%d", x);
}Select an option to see the answer and solution.
#include <stdio.h>
int *p = NULL;
int main()
{
int i = 0;
p = &i;
return 0;
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
#include <stdio.h>
int x;
void main()
{
printf("%d", x);
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
#include <stdio.h>
#define MIN 0
#if defined(MIN) + defined(MAX)
#define MAX 10
#endif
int main()
{
printf("%d %d\n", MAX, MIN);
return 0;
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
#include <stdio.h>
int foo(int, int);
#define foo(x, y) x / y + x
int main()
{
int i = -6, j = 3;
printf("%d ",foo(i + j, 3));
#undef foo
printf("%d\n",foo(i + j, 3));
}
int foo(int x, int y)
{
return x / y + x;
}Select an option to see the answer and solution.
#include <stdio.h>
int x;
void main()
{
m();
printf("%d", x);
}
void m()
{
x = 4;
}Select an option to see the answer and solution.
#include <stdio.h>
int foo();
int main()
{
int i = foo();
}
foo()
{
printf("2 ");
return 2;
}Select an option to see the answer and solution.