Basic C Programming MCQ

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