Sail E0 Webinar

MCQs

Total Questions : 13 | Page 2 of 2 pages
Question 11. What will be output after executing following code?
#include
# define a 10
void main()
{
printf("%d..", a);
foo();
printf("%d", a);
}
void foo()
{
#undef a
#define a 50
}
  1.    10..50
  2.    10..10
  3.    0
  4.    Error
 Discuss Question
Answer: Option B. -> 10..10
Question 12. The output of the following program is:
#define f(g,g2) g##g2
void main()
{
int var12=100;
printf("%d", f(var,12));
}
  1.    Syntax error
  2.    Runtime error
  3.    g##g2
  4.    100
  5.    10012
 Discuss Question
Answer: Option D. -> 100
Question 13. Find the output of the following program.
#define INC(X) X++
void main()
{
int x=4;
printf("%d", INC(x++));
}
  1.    4
  2.    5
  3.    6
  4.    Error
 Discuss Question
Answer: Option D. -> Error

Latest Videos

Latest Test Papers