Basic C Programming MCQ Questions and Answers

Practice Mode
Showing 10 of 198 questions
Q31
Pick the operators that associate from the right
  • A ?:
  • B +=
  • C =
  • D !=
Answer: Option
Q32
Pick the operators whole meaning is context dependent.
  • A *
  • B #
  • C &
  • D No such operator exists
Answer: Option
Q33
Pick the operator that associate from the fleft
  • A &&
  • B ||
  • C ?:
  • D ,
Answer: Option
Q34
The following code fragment int x, y = 2 z, a; x = (y * = 2) + (z = a = y); Print ("%d", x);
  • A prints 8
  • B prints 6
  • C prints 6 or e depending on the compiler implementation
  • D is syntactically wrong
Answer: Option C
Q35
If n has the value 3, then the output of the statement printf("%d %d", n++, ++n);
  • A is 3 5
  • B is 4 5
  • C is 4 4
  • D is implementation dependent
Answer: Option D
Q36
x -= y + 1; means
  • A x=x -y +1
  • B x =-x -y -1
  • C x=-x + y +1
  • D x =x -y -1
Answer: Option D
Q37
Which of the following comments about the ++ operator are correct ?
  • A It is a unary operator
  • B The operand can come before or after the operator
  • C It cannot be applied to an expression
  • D It associated from the right
Answer: Option
Q38
In standard C, trigraphs in the source program are translated
  • A before the lexical analysis
  • B after the syntax analysis
  • C before the recognition of escape characters in strings
  • D during the intermediate code generation phase
Answer: Option
Q39
The expression 5 - 2 - 3 + 5 - 2 will evaluate to 18, if
  • A - is left associative and * has precedence over -
  • B - is right associateive and * has precedence over -
  • C - is right associative and - has precedence over *
  • D - is left associative and - has precedence over *
Answer: Option C
Q40
Printf ("%c", 100) ;
  • A prints 263
  • B prints the ASCII equivalent of 263
  • C rings the bell
  • D prints garbage
Answer: Option C
Questions and Answers for Competitive Exams Various Entrance Test