Algorithm & Flowchart
Algorithm & Flowchart
163 Grp: 4
Algorithm & Flowchart of Area of Circle
*Algorithm
1} Start
3} Calculate Area=3.142*(r*r)
5} Stop
*Flowchart
Start
Accept r
Calculate
Area=3.142*(r*r)
Print Area
Stop
Algorithm & Flowchart for To Check the
number Positive or Negative
*Algorithm
1} Start
Else
4} Stop
*Flowchart
Start
Accept n
If
yes no
Stop
Algorithm & Flowchart for Sum of n
Number
*Algorithm
1} Start
4} if (i>n) go to step 8
5} sum=sum+i
6} i=i+1
Start
7} go to step 4
If(i>n) yes
no
sum=sum+i i=i+1
Stop
Algorithm & Flowchart for finding a
number Prime or not
*Algorithm
1} Stop
Else
Go to step 6
5} p=1
Else
Go to step 11
10} Go to step 12
12} Stop
start
*Flowchart
i=2 , p=2
Accept n
p=1 Check
i=i+1
I<n
P==0 or n=2
no yes
Print number is not prime Print number is prime
stop
Algorithm & Flowchart for Factors of a
number
*Algorithm
1} Start
2} Accept n
Else go to step 4
Else go to step 5
6) stop Start
Accept n
*Flowchart
yes
Whether i=num
reached?
no
If (n%i==0)
Print i
Compute i=i+1
Stop