11. Which variable has the longest scope in the following C code?
#include <stdio.h>
int b;
int main()
{
int c;
return 0;
}
int a;
#include <stdio.h>
int b;
int main()
{
int c;
return 0;
}
int a;
12. Which of the following sequences are unaccepted in C language?
13. Comment on the output of the following C code.
#include <stdio.h>
int main()
{
int i;
for (i = 0;i < 5; i++)
int a = i;
printf("%d", a);
}
#include <stdio.h>
int main()
{
int i;
for (i = 0;i < 5; i++)
int a = i;
printf("%d", a);
}
14. What will be the output of the following C code?
#include <stdio.h>
void foo();
int main()
{
void foo(int);
foo();
return 0;
}
void foo()
{
printf("2 ");
}
#include <stdio.h>
void foo();
int main()
{
void foo(int);
foo();
return 0;
}
void foo()
{
printf("2 ");
}
15. What will be the output of the following C code?
#include <stdio.h>
int x = 5;
void main()
{
int x = 3;
printf("%d", x);
{
int x = 4;
}
printf("%d", x);
}
#include <stdio.h>
int x = 5;
void main()
{
int x = 3;
printf("%d", x);
{
int x = 4;
}
printf("%d", x);
}
16. 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;
}
17. The preprocessor provides the ability for . . . . . . . .
18. What will be the output of the following C code?
#include <stdio.h>
void main()
{
static double x;
int x;
printf("x is %d", x);
}
#include <stdio.h>
void main()
{
static double x;
int x;
printf("x is %d", x);
}
19. Which of the following operation is not possible in a register variable?
20. Which of the following Macro substitution are accepted in C?
Read More Section(Function)
Each Section contains maximum 100 MCQs question on Function. To get more questions visit other sections.