Professional Documents
Culture Documents
Activity Section
Looping Activity 1
a. Problem
Write a program that will presents the digits 1, 2, 3, 4, 5
sequentially using the for loop.
b. Algorithm
-Input: -----
-Process: increases the value by 1 (starts with 1)
-Output: displays 1 to 5
c. Flowchart
e. Program Output
Looping Activity 2
a. Problem
Write a C program shows the digits 5, 4, 3, 2, and 1 sequentially
using the for loop.
b. Algorithm
-Input: ----
-Process: decreases the value by 1 (starts with 5)
-Output: displays 5 to 1
c. Flowchart
The figure above indicates the procedure the program must follow.
The program starts with noting the variable n is equal to 5. Since the digit is
more than 1, the program prints this value to the screen. The program then
loops and decreases this number by one until the statement n>=1 is
disproven. Afterwards, the program stops.
d. Source Code
e. Program Output
Looping Activity 3
a. Problem
Write a C program that determines the sum of the sequential digits
1, 2, 3, 4, and 5 using for loop.
b. Algorithm
-Input: -----
-Process: increases the value by 1 (starts with 1)
-Output: displays 1 to 5 and the sum of these digits
c. Flowchart
d. Source Code
e. Program Output
Looping Activity 4
a. Problem
Make a C program that makes use of the while loop which
sequentially shows the following numbers: 1, 2, 3, 4, and 5.
b. Algorithm
-Input: --
-Process: increases the value by 1 (starts with 1)
-Output: displays 1 to 5
c. Flowchart
e. Program Output
Looping Activity 5
a. Problem
Make a C program that will generate the digits 1, 2, 3, 4, and 5
sequentially using the do-while loop.
b. Algorithm
-Input: -----
-Process: increases the value by 1 (starts with 1)
-Output: displays 1 to 5
c. Flowchart
e. Program Output
Looping Activity 6
a. Problem
Make a C program that will determine the summation of 1, 2, 3, 4,
and 5 using the while loop.
b. Algorithm
-Input: ----
-Process: increases the value by 1 (starts with 1)
-Output: displays 1 to 5 and the sum of these digits
c. Flowchart
e. Program Output
Looping Activity 7
a. Problem
Make a C program that will determine the summation of 1, 2, 3, 4,
and 5 using a do-while loop.
b. Algorithm
-Input: --
-Process: increases the value by 1 (starts with 1)
-Output: displays 1 to 5 and the sum of these digits
c. Flowchart
e. Program Output
III. Supplementary Section
Looping Supplementary 1
a. Supplementary Worded Problem
Write a C program that will determine the even numbers from ten
random inputted numbers and display the summation of these
even numbers.