Flowchart and Algorithm
Flowchart and Algorithm
1. Input
2. Output
3. Definiteness
4. Fineness
5. Effectiveness
Step 1: Start
Step 2: Declare variables num1, num2 and sum.
Step 3: Read values num1 and num2.
Step 4: Add num1 and num2 and assign the result
to sum.
sum←num1+num2
Step 5: Display sum
Step 6: Stop
Step 1: Start
Step 2: Declare variables a, b and c.
Step 3: Read variables a, b and c.
Step 4: If a>b
If a>c
Display a is the largest number.
Else
Display c is the largest number.
Else
If b>c
Display b is the largest number.
Else
Display c is the greatest number.
Step 5: Stop Programming in C - Algorithm and Flowchart : Instructor - Ms. Anita C 4
Algorithm
To display Average of a set of given numbers.
1. Start
2. Declare variables n, i, x, sum
3. Read the value of n.
4. Initialize i = 1 , sum = 0
5. if i > n go to 10
6. Read the value of x.
7. sum = sum + x
8. i = i + 1
9. go to 5
10.average = sum / n
11.Display average.
12.Stop
Programming in C - Algorithm and Flowchart : Instructor - Ms. Anita C 5
Flowchart