Algorithm Flow Chat
Algorithm Flow Chat
Shroouq Jumaa
Le cture2
Examples of Algorithm
Problem 1: Find the area of a Circle of radius r.
Inputs to the algorithm:
Radius r of the Circle.
Expected output:
Area of the Circle
Algorithm:
Step1: Start
Step2: Read\input the Radius r of the Circle
Step3: Area PI*r*r // calculation of area
Step4: Print Area
Step5: End
Problem2: Write an algorithm to read two numbers and find their sum.
Inputs to the algorithm:
First num1.
Second num2.
Expected output:
Sum of the two numbers.
Algorithm:
Step1: Start
Step2: Read\input the first num1.
Step3: Read\input the second num2.
Step4: Sum num1+num2 // calculation of sum
Step5: Print Sum
Step6: End
Problem 3: Convert temperature Fahrenheit to Celsius
Inputs to the algorithm:
Temperature in Fahrenheit
Expected output:
Temperature in Celsius
Algorithm:
Step1: Start
Step 2: Read Temperature in Fahrenheit F
Step 3: C 5/9*(F32)
Step 4: Print Temperature in Celsius: C
Step5: End
1
Le cture2
Type of Algorithms
The algorithm and flowchart, classification to the three types of control
Structures. They are:
1. Sequence
2. Branching (Selection)
3. Loop (Repetition)
These three control structures are sufficient for all purposes. The
sequence is exemplified by sequence of statements place one after the
other the one above or before another gets executed first. In flowcharts,
sequence of statements is usually contained in the rectangular process
box.
Le cture2
Le cture2