Diagnostic Test For C Q1 1
Diagnostic Test For C Q1 1
Quarter 1
Name: _____________________________________________________ Score:_____________
Year & Section: ______________________________________________ Date: _____________
Part I.
Directions: Read each item carefully and choose the best letter of your answer.
1. How do you declare the variable BODY TEMPERATURE in C++ programming language?
a. declare as int c. declare as double
b. declare as char d. declare as string
6. I would like to insert comments in the source code. How can I apply comments?
a. use // c. use “ ”
b. use { } d. use ;
7. I would like to display some characters on the computer screen. How can I display characters?
a. use // c. use “”
b. use { } d. use ;
8. Syntax error report shows missing end of the statement. How can I fix this problem?
a. use // c. use “ ”
b. use { } d. use ;
9. How can I determine that this line of code starts and ends the function?
a. use // c. use “ ”
b. use { } d. use ;
10. I would like to ask the age of the user, how can I read the characters typed by the user from the
keyboard?
a. use // c. use cout
b. use “ ” d. use cin
11. How do you get or solve for the product of variables A and B?
c. use operator + c. use operator *
d. use operator - d. use operator /
12. How do you get or solve for the ratio of variables A and B?
a. use operator + c. use operator *
b. use operator - d. use operator /
13. How do you get or solve for the difference of variables A and B?
a. use operator + c. use operator *
b. use operator - d. use operator /
14. How do you get or solve for the sum of variables A and B?
a. use operator + c. use operator *
b. use operator - d. use operator /
15. How do you get or solve for the sum of variables A and B?
a. use operator + c. use operator *
b. use operator - d. use operator /
18. Determine the value of the expression (5==5) && (3 > 6)?
a. true c. cannot determine the value
b. false
26. In this line of code: for (int n=10; n>0; n--), which one is for initialization?
a. int n=10 c. n--
b. n>0
27. In this line of code: for (int n=10; n>0; n--), which one is for condition?
a. int n=10 c. n--
b. n>0
28. In this line of code: for (int n=10; n>0; n--), which one is for increase/decrease?
a. int n=10 c. n--
b. n>0
29. In this line of code: for ( n=0, i=50 ; n!=i ; n++, i-- ), what will be the final value of n?
a. 0 c. 50
b. 25
30. In this line of code: for ( n=0, i=50 ; n!=i ; n++, i-- ), what will be the final value of i?
a. 0 c. 50
b. 25
31. Which jump statement will you use if you want to end the loop?
a. break b. continue c. goto
32. Which jump statement will you use if you want to skip the rest of the loop in the current iteration and
jump to the start of the following iteration?
a. break b. continue c. goto
34. Which of the following is initialization in the statement (int n=0; n<10; n++)?
a. int n = 0 b. n < 10 c. n++
35. Which of the following is condition in the statement (int n=0; n<10; n++)?
a. int n = 0 b. n < 10 c. n++
Prepared by:
ROMEO P. OPENA JR
TLE-ICT Teacher
Checked by:
SALVACION D. ENSO
Head Teacher IV - TLE