Sail E0 Webinar

MCQs

Total Questions : 209 | Page 20 of 21 pages
Question 191. Find the output of the following program.void main(){ printf("%d, %d", sizeof(int *), sizeof(int **));}
  1.    4, 4
  2.    2, 2
  3.    0, 2
  4.    2, 4
  5.    2, 0
 Discuss Question
Answer: Option B. -> 2, 2
Question 192. What would be the output for the following Turbo C code?#includevoid main(){ int a[]={ 1, 2, 3, 4, 5 }, *p; p=a; ++*p; printf("%d ", *p); p += 2; printf("%d", *p);}
  1.    2 2
  2.    3 3
  3.    2 3
  4.    2 4
  5.    3 4
 Discuss Question
Answer: Option C. -> 2 3
Question 193. Find the output of the following program.void main(){ int i=10; /* assume address of i is 0x1234ABCD */ int *ip=&i; int **ipp=&&i; printf("%x,%x,%x", &i, ip, *ipp); }
  1.    Syntax error
  2.    0x1234ABCD, 0x1234ABCD, 0x1234ABCD
  3.    Runtime error
  4.    0x1234ABCD, 0x1234ABCD, 10
  5.    0x1234ABCD, 10, 10
 Discuss Question
Answer: Option A. -> Syntax error
Question 194. What is the base data type of a pointer variable by which the memory would be allocated to it?
  1.    float
  2.    Depends upon the type of the variable to which it is pointing.
  3.    No data type
  4.    int
  5.    unsigned int
 Discuss Question
Answer: Option E. -> unsigned int
Question 195. Which of the following statements are true after execution of the program.void main(){ int a[10], i, *p; a[0] = 1; a[1] = 2; p = a; (*p)++;}
  1.    a[1] = 3
  2.    a[1] = 2
  3.    Compilation error
  4.    a[0] = 3
  5.    a[0] = 2
 Discuss Question
Answer: Option E. -> a[0] = 2
Question 196. Char *ptr;char myString[] = "abcdefg";ptr = myString;ptr += 5;what string does ptr point to in the sample code above?
  1.    efg
  2.    cdefg
  3.    fg
  4.    defg
  5.    bcdefg
 Discuss Question
Answer: Option C. -> fg
Question 197. What will be the output of the following program?#include#define square(x) x*x void main(){ int i; i = 64/square(4); printf("%d", i); }
  1.    16
  2.    64
  3.    4
  4.    None of These
 Discuss Question
Answer: Option B. -> 64
Question 198. A preprocessor command
  1.    need not start on a new line
  2.    comes before the first executable statement
  3.    need not start on the first column
  4.    has # as the first character
 Discuss Question
Answer: Option D. -> has # as the first character
Question 199. What will be the output of the program?#include#define int char void main(){ int i = 65; printf("sizeof(i)=%d", sizeof(i));}
  1.    None of These
  2.    Compiler Error
  3.    sizeof(i)=1
  4.    sizeof(i)=2
 Discuss Question
Answer: Option C. -> sizeof(i)=1
Question 200. C preprocessor
  1.    Takes care of include files
  2.    Takes care of conditional compilation
  3.    Takes care of macros
  4.    All of these
  5.    Acts before compilation
 Discuss Question
Answer: Option D. -> All of these

Latest Videos

Latest Test Papers