C Programming: MCQ Set – 01

C Programming: MCQ Set – 01

Q1: The goal of operator overloading is

  • (A) to help the user of a class
  • (B) to help the developer of a class
  • (C) to help define friend function
  • (D) None of the above

Q2: If an integer needs two bytes of storage, then the maximum value of unsigned integer is

  • (A) (216) – 1
  • (B) (215) – 1
  • (C) 215
  • (D) 216

Q3: The __________ statement causes immediate exit from the loop overriding the condition test

  • (A) Exit
  • (B) Break
  • (C) Goto
  • (D) None of the above

Q4: The following program fragment

int *a;

*a = 7;

  • (A) assigns 7 to a
  • (B) results in compilation error
  • (C) assigns address of a as 7
  • (D) segmentation fault

Q5: The decimal value 0.5 in IEEE single precision floating point representation has

  • (A) fraction bits of 000…000 and exponent value of 0
  • (B) fraction bits of 000…000 and exponent value of -1
  • (C) fraction bits of 100…000 and exponent value of 0
  • (D) no exact representation

Q6: The statement which is used to terminate the control from the loop is

  • (A) Break
  • (B) Continue
  • (C) Goto
  • (D) Exit

Q7: The value of an automatic variable that is declared but not initialized will be

  • (A) 0
  • (B) -1
  • (C) Unpredictable
  • (D) None of these

Q8: The _______ memory allocation function modifies the previous allocated space.

  • (A) calloc( )
  • (B) free( )
  • (C) malloc( )
  • (D) realloc( )

Q9: Unsigned integer occupies

  • (A) Two bytes
  • (B) Four bytes
  • (C) One byte
  • (D) Eight bytes

Q10: The value that follows the keyword CASE may only be

  • (A) Constants
  • (B) Variable
  • (C) Number
  • (D) Semicolon

Answer:

QuestionQ1Q2Q3Q4Q5Q6Q7Q8Q9Q10
AnswerAABDCACDBA