Basic C Programming MCQ

Basic C Programming MCQ
11. Consider the statement putchar (getchar {}); putchar (getchar {}); if a b is the input, the output will be
  • an error message
  • this can't be the input
  • ab
  • a b
Show Answer
12. Let a, b be two positive integers. Which of the following options correctly relates / and % ?
  • b = (a/b) *b + a%b
  • a = (a/b) *b + a%b
  • b = (a%b) *b +a/b
  • a = (a%b) *b a/b
Show Answer
13. Literal means
  • a string
  • a string constant
  • a character
  • an alphabet
Show Answer
14. Length of the string "correct' is
  • 7
  • 8
  • 6
  • implementation depend
Show Answer
15. Which of the following are true regardless of the implementation ?
  • sizeof (int) is not less than sizeof (long)
  • sizeof (short) equals sizeof (int)
  • sizeof (int) equals sizeof (unsigned)
  • sizeof (double) is not less than sizeof (float)
Show Answer
16. Coercion
  • takes place across an assignment operator
  • takes place if an operator has operands of different data types.
  • means casting
  • none of the above
Show Answer
17. Choose the correct statements
  • Casting refers to implicity type conversion
  • Casting refers to implicity type conversion
  • Casting refers to explicit type conversion
  • Coercion refers to explicit type conversion
Show Answer
18. Consider the following program fragment char c = 'a'; while (c++ <= 'z') putchar (xxx) If the required output is abcdefghijklmnopqrstuvwxyz, then xxx should be
  • c
  • c++
  • c-1
  • -c
Show Answer
19. Which of the following comments are true?
  • C provides no input-output feature
  • C provides no file access features.
  • C borrowed most of its ideas from BCPL
  • C provides no features to manipulate composite objects
Show Answer
20. If y is of integer type then the expression 3 * (y - 8) / 9 and ( y - 8) / 9 * 3
  • must yield the same value
  • must yield different values
  • may or may not yield the same value
  • none of the above
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test