Professional Documents
Culture Documents
Summa 4 TH
Summa 4 TH
Punzalan 05 – 31 – 22
10 – Mosely
SUMMATIVE TEST
I. Identification
1. Loop
2. Loop Control Condition
3. Counter Variable
4. 1
5. Do-while loop
6. Loop Body
7. Accumulator Variable
8. While Loop
9. Do-while loop
10. For loop
II. Multiple Choice
1. A
2. B
3. A
4. C
5. D
6. B
7. A
8. C
9. D
10. B
11. A
12. C
13. A
14. D
15. C
III. Answer as required
16. 20
17. 400
18.
#include <iostream>
using namespace std;
int main()
{
for(int x = 1; x <= 50; x++)
{
cout << x << endl;
}
}
19.
#include <iostream>
using namespace std;
int main() { int x = 1; do
{
cout << "Computer Science Gods" << endl;
}
while (x<=10);
}
}
20.
#include <iostream>
using namespace std;
int main()
{
int x = 1; while(x <= 20)
{
cout << "Viva MASCI" << endl; x++;
}
}
21-22.
int x = 99;
do
23-24.
int x;
25.
#include <iostream>
int main()
2.
RRRRRRRRR
RR-----RR
R-R---R-R
R--R-R--R
R---R---R
R--R-R--R
R-R---R-R
RR-----RR
RRRRRRRRR
3.
--------9
-------98
------987
-----9876
----98765
---987654
--9876543
-98765432
987654321
4.
-1357997531ILOVECS
--13577531ILOVECS
---135531ILOVECS
----1331ILOVECS
-----11ILOVECS
V. Programming
1.
2.
3.