Sail E0 Webinar

MCQs

Total Questions : 209 | Page 21 of 21 pages
Question 201. In which stage the following code#includegets replaced by the contents of the file stdio.h
  1.    None of these
  2.    During Preprocessing
  3.    During Execution
  4.    During linking
  5.    During Editing
 Discuss Question
Answer: Option B. -> During Preprocessing
Question 202. Determine output:#include#define clrscr() 100void main(){ clrscr(); printf("%dn", clrscr());}
  1.    Error
  2.    0
  3.    100
  4.    1
 Discuss Question
Answer: Option C. -> 100
Question 203. What will be the output of the program code?#include#define a 10void main(){ #define a 50 printf("%d", a);}
  1.    None of These
  2.    10
  3.    Compiler Error
  4.    50
 Discuss Question
Answer: Option D. -> 50
Question 204. What will be the output of the following program?#include#define prod(a,b) a*bvoid main(){ int x=3,y=4; printf("%d", prod(x+2,y-1));}
  1.    15
  2.    11
  3.    12
  4.    10
  5.    None of these
 Discuss Question
Answer: Option D. -> 10
Question 205. Choose the correct statement.I.   The scope of a macro definition need not be the entire program.II.  The scope of a macro definition extends from the point of definition to the end of the file.III. New line is a macro definition delimiter.IV.  A macro definition may go beyond a line.
  1.    II and III
  2.    I and II
  3.    I, II, III and IV
  4.    I, II and III
  5.    II, III and IV
 Discuss Question
Answer: Option C. -> I, II, III and IV
Question 206. What will be output if you will compile and execute the following c code?#include#define max 5void main(){ int i = 0; i = max++; printf("%d", i++);}
  1.    7
  2.    0
  3.    6
  4.    5
  5.    Compiler Error
 Discuss Question
Answer: Option E. -> Compiler Error
Question 207. Find the output of the following program.#define INC(X) X++void main(){ int x=4; printf("%d", INC(x++));}
  1.    6
  2.    4
  3.    5
  4.    Error
 Discuss Question
Answer: Option D. -> Error
Question 208. The output of the following program is:#define f(g,g2) g##g2void main(){ int var12=100; printf("%d", f(var,12));}
  1.    Syntax error
  2.    Runtime error
  3.    10012
  4.    g##g2
  5.    100
 Discuss Question
Answer: Option E. -> 100
Question 209. What will be output after executing following code?#include# define a 10void main(){ printf("%d..", a); foo(); printf("%d", a);}void foo(){ #undef a #define a 50}
  1.    10..50
  2.    Error
  3.    10..10
  4.    0
 Discuss Question
Answer: Option C. -> 10..10

Latest Videos

Latest Test Papers