51. 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);
}
#include <stdio.h>
int x = 5;
void main()
{
int x = 3;
printf("%d", x);
{
x = 4;
}
printf("%d", x);
}
52. 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;
}
#include <stdio.h>
int *p = NULL;
int main()
{
int i = 0;
p = &i;
return 0;
}
53. What would happen if you create a file stdio.h and use #include "stdio.h"?
54. What will be the output of the following C code?
#include <stdio.h>
int x;
void main()
{
printf("%d", x);
}
#include <stdio.h>
int x;
void main()
{
printf("%d", x);
}
55. Automatic variables are initialized to . . . . . . . .
56. What will be the output of the following C code?
#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;
}
#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;
}
57. Functions can return enumeration constants in C?
58. What will be the output of the following C code?
#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;
}
#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;
}
59. What will be the output of the following C code?
#include <stdio.h>
int x;
void main()
{
m();
printf("%d", x);
}
void m()
{
x = 4;
}
#include <stdio.h>
int x;
void main()
{
m();
printf("%d", x);
}
void m()
{
x = 4;
}
60. What will be the output of the following C code?
#include <stdio.h>
int foo();
int main()
{
int i = foo();
}
foo()
{
printf("2 ");
return 2;
}
#include <stdio.h>
int foo();
int main()
{
int i = foo();
}
foo()
{
printf("2 ");
return 2;
}
Read More Section(Function)
Each Section contains maximum 100 MCQs question on Function. To get more questions visit other sections.