Q#1: if (a>b && a>c) then the condition will be true only if
(A) Both a>b and a>c are true *
(B) a>b is false and a>c is true
(C) a>b is true and a>c is false
(D) Both a>b and a>c are false
Answer: (A) Both a>b and a>c are true
Q#2: In a while loop the loop counter must be initialized
(A) Within the loop
(B) Before entering the loop *
(C) At the end of the loop
(D) None of the given options
Answer: (B) Before entering the loop
Q#3: ___ of a variable means the locations within a program from where it can be accessed
(A) Data type
(B) Visibility *
(C) Value
(D) Reference
Answer: (B) Visibility
Q#4: Switch supports ___ data
(A) Integer
(B) Character
(C) Float
(D) Both integer and character *
Answer: (D) Both integer and character
Q#5: A function is a block of statements that can be defined once and used ___ in the program
(A) One time
(B) Two times
(C) Three times
(D) As many times as user wants *
Answer: (D) As many times as user wants
Q#6: ___ statement is used to terminate the processing of a particular case and exit from switch structure
(A) if
(B) goto
(C) break *
(D) continue
Answer: (C) break
Q#7: The most suitable data type for number 325.25 is
(A) char
(B) int
(C) short
(D) float *
Answer: (D) float
Q#8: X is an integer variable; what does X++ mean
(A) Add 1 two times in X value
(B) Add 1 in X value *
(C) Add 2 in X value
(D) None of these
Answer: (B) Add 1 in X value
Q#9: The operators ++ and — are used to increment or decrement the value of a variable by
(A) 1 *
(B) 2
(C) 3
(D) 4
Answer: (A) 1
Q#10: Which of the following loops checks the test condition at the end of the loop?
(A) While
(B) Do-While *
(C) For
(D) Nested Loop
Answer: (B) Do-While