Professional Documents
Culture Documents
2. The value of 7 - 5 + 4 * 3 is
a) 18
b) 4
c) 14
d) none of these
a) RAM
b) ROM
c) CD
d) floppy drive
e) hard drive
a) CPU
b) Memory
c) ALU
d) Hard Disk
a) global variable
b) local variable
c) constant variable
d) non local variable
7. How many times will the following looping structure be executed?
count = 1;
do {
count++;
cin num;
}
while (count < 10);
a) 20 times
b) 10 times
c) 9 times
d) none of the above
a) and
b) or
c) not
d) if
11. When parameters are passed between the calling code and the called
function,formal and actual parameters are matched by:
a) class
b) Simple data type
c) Data structure containing multiple values
d) Iterative structure
a) 0 to 20
b) 1 to 20
c) 1 to 19
d) 0 to 19
if (A B)
if (B C)
cout << 1 << endl;
else
cout << 2 << endl;
a) strings
b) an array
c) a class
d) float variables
a) properties
b) behavior
c) initialization constructors
d) destructors
e) all of the above
19. Which type of loop is the following (assume variables are type float):
cin score;
while (score != -1)
{ sum += score;
cin score;
}
a) Sentinel controlled
b) Flag controlled
c) Count controlled
d) Even controlled
e) None of the above
a) 0 values
b) 1 value
c) 2 values
d) any number of values
Answers:
1. d 2. c 3. a 4. c 5. b 6. a
7. c 8. d 9. d 10. d 11. b 12. c
13. c 14. d 15. a 16. c 17. d 18. e
19. a 20. b