C - Files and Preprocessors Questions and Answers

Practice Mode
Showing 10 of 96 questions
Q91
What is the output of the following code ? enum alphanum { VARIABLE=S, DIGIT=10, VARIABLE=11 }; PRINTF("%D", DIGIT);
  • A Compilation error
  • B Execution error
  • C 10
  • D 6
Answer: Option A
Q92
What is the output of the following code ? enum control { on, off, neutral }; PRINTF ("%d", off);
  • A Compliation error
  • B Execution error
  • C 5
  • D 1
Answer: Option A
Q93
identify the correct statement. 1. The typedef defines synonyms for a an existing data type. 2. the typedef creates a new data type that is not existing in C. 3. the typedef helps in easier modification of a portable program. 4. The typedef gives meaningful namels to a data type.
  • A options 1, 3 and 4
  • B options 1 and 4
  • C options 2 and 3
  • D options 2, 3 and 4
Answer: Option A
Q94
Identify the valid data type of the variable fraction in the following code. typedef float HOST; HOST fraction;
  • A int and HOST
  • B struct and HOST
  • C enum and HOST
  • D float and HOST
Answer: Option B
Q95
Given the following declaration, identify the correct definition. typedef struct node { int id; char name [20]; };
  • A node n;
  • B NODE n;
  • C typedef NODE n;
  • D typedef node n;
Answer: Option B
Q96
The purpose of the following code is no find #include < time.. main () { time _t t1, t2; clock _t clock (void) int i,x=0, y=10; for(i=0; i<1000; i++) { xc++; y+=50; printf ("The value of i=%d, x = %d, y = %d\n", i, x, y); } t2 = clock ( ) ; printf ("Time in seconds :%g\n", difftime(t2,t1)/ CLOCKS_PER_SEC); }
  • A compilation time
  • B execution time
  • C difference between GST and IST
  • D difference between compilation and execution times.
Answer: Option B
Questions and Answers for Competitive Exams Various Entrance Test