### Flowcahrt Tatourial - CS 240 - Computer Programming in C++ I

```Flowchart Tutorial
Start or end of the program
Computational steps or processing
function of a program
Input or output operation
Decision making and branching
Connector or joining of two parts of
program
Example 1:
Draw a flowchart to find the
sum of first 50 natural
numbers.
start
SUM=0
N=0
N=N+1
SUM=SUM+N
no
IS
N==50?
yes
Print SUM
END
Example 2
Draw a flowchart to find the
largest of three numbers A, B,
and C.
START
yes
IS
B >C ?
no
IS A>B
?
yes
IS
A>C ?
yes
no
no
PRINT C
PRINT B
END
PRINT A
Example 3
Draw a flowchart for program
Find the difference and the
division of two numbers and
display the result.
START
READ N1 , N2
D=N1-N2
V=N1/N2
PRINT D , V
STOP
Example 4
Draw a flowchart for program
Print the first 10 natural
number
start
N=1
Print N
N=N+1
yes
while
N <= 10
no
END
Example 6
Draw a flowchart for program Calculate the
student grade ( A,B,C,D,F)
start
Print
A
yes
>=90
no
Print
B
yes
>=80
no
Print
C
yes
>=70
no
Print
D
yes
>=60
no
END
Print
F
Example 7
Draw a flowchart for program read
temperature , If temp > 0 print above
freezing else below freezing
start
Print“above
freezing”
yes
Temp >0
no
Print“below
freezing”
End
Example 8
Draw a flowchart for program
read (10) marks for (20)
students, then print the
average for each student.
START
studentCount=0
markCount=0
sUM=0 , avg=0
no
While
studentCount
<20
STOP
yes
While
markCount<
10
no
avg=sUM/10
yes