Tag Archives: loop

Factorial Flow Chart

C Programming Examples – Factorial using Loop Statement

Problem: Write a program that will compute for n! (N Factorial).

Sample Output: Enter Number: 6 1 2 3 4 5 6 The factorial value is 720 Solution:

Flow Chart

C Programming Examples – Displaying Even Numbers using Loop Statement

Problem: Write a program that will display all even numbers from 0 to n (input number).

Example Output: Enter Number: 21 0 2 4 6 8 10 12 14 16 18 20

Averaging Using Loop - Flowchart

C Programming Examples – Averaging Using Loop Statement

Problem: Create a program that will accept ages of 10 people and display its average. Use any kind of iteration statement but do not use Arrays.

Solution: First lets see an example output. Enter age1: 5 Enter age2: 10 Enter age3:28 Enter age4: 7 Enter age5: 5 Enter age6: 18 Enter age7: 14 Enter age8: 16 Enter age9: 19 Enter age10: 22 The average age is: … Continue reading