Basic C Programming MCQ Questions and Answers

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