C & C++ Programming Multiple Choice Questions - Set 1

1.       The statement char ch = ‘Z’ would store in ch :
(A) The character Z
(B) ASCII value of Z
(C) Z along with the single inverted commas
(D) Both (A) and (B)
Answer: B
2.       Which of the following is NOT a character constant?
(A) ‘Thank You’
(B) ‘Enter values of P, N, R’
(C) ‘23.56E-03’
(D) All the above
Answer: D
3.       The maximum value that an integer constant can have is .................
(A) -32767
(B) 32767
(C) 1.7014e+38
(D) –1.7014e+38
Answer: B
4.       A C variable cannot start with .............
(A) An alphabet
(B) A number
(C) A special symbol other than underscore
(D) Both (B) & (C) above
Answer: D
5.       Which of the following statement is wrong ?
(A) mes = 123.56;
(B) con = 'T' * 'A';
(C) this = 'T' * 20;
(D) 3 + a = b;
Answer: D

6.       Which of the following shows the correct hierarchy of arithmetic operators in C ?
(A) **, * or /, + or -
(B) **, *, /, +, -
(C) **, /, *, +, -
(D) / or *, - or +
Answer: D
7.       In b = 6.6 / a + 2 * n; which operation will be performed first?
(A) 6.6 / a           (B) a + 2
(C) 2 * n             (D) Depends upon compiler
Answer: D
8.       Which of the following is allowed in a C Arithmetic instruction?
(A) [ ]      (B) { }
(C) ( )      (D) None of the above
Answer: C
9.       Which of the following statements is false ?
(A) Each new C instruction has to be written on a separate line
(B) Usually all C statements are entered in small case letters
(C) Blank spaces may be inserted between two words in a C statement
(D) Blank spaces cannot be inserted within a variable name
Answer: A
10.    If a is an integer variable, a = 5/2; will return a value
(A) 2.5    (B) 3
(C) 2       (D) 0
Answer: C


Post a Comment

1 Comments