Writing an algorithm
An algorithm can be written in English, like sentences and using mathematical formulas. Sometimes algorithm written in English like language is Pseudo code.
Examples
1) Finding the average of three numbers
1. Let a,b,c are three integers
2. Let d is float
3. Display the message “Enter any three integers:”
4. Read three integers and stores in a,b,c
5. Compute the d = (a+b+c)/3.0
6. Display “The avg is:” , d
7. End.
No comments:
Post a Comment