4-27TH-JAN-Algorithm & Flowchart
4-27TH-JAN-Algorithm & Flowchart
Input / output
Processing connector
Decision making
Write an algorithm and flow chart to find the
sum of two numbers.
Algorithm :
1)Start
2)Read / input number1 and number2
3) sumnumber1+number2
4)Print sum
5)Stop
Draw the corresponding flow chart.
Continued..
• Flow chart
start
Read Number1 ,
Number2
Sum=Number1+Number2
Print Sum
stop
Area and perimeter of Rectangle
Algorithm :
1)Start
2)Read / input length and breadth
3)arealength* breadth
4)perimeter2*(length+breadth)
4)Print area, perimeter
5)Stop
Draw the corresponding flow chart.
Area and perimeter of circle
Write algorithm and draw flowchart.
Area and perimeter of a rectangle
Convert a temperature from farenheit
to centigrade
C=5/9( F-32)
Write algorithm and draw flowchart
Find the area of a triangle having
unequal sides a,b,c
• s=(a+b+c)/2
• Area= sqrt(s*(s-a)*(s-b)*(s-c))
• Write algorithm and draw flowchart
Find the maximum of two integers a
and b
• Write algorithm and draw flowchart
Find the maximum of three integers
a,b and c
• Write algorithm and draw flowchart
Find the integer is even or odd
• Write algorithm and draw flowchart
Find the roots of a quadratic
equation ax2+bx+c=0
Algorithm :
1) Start
2) Read / input coefficents a,b and c
3) Discrimant d= b2 – 4ac
4) If (d==0)
Root1=root2= -b/2a
5) If (d>0)
Root1= (-b+sqrt(d))/ 2a
Root2= (-b-sqrt(d))/ 2a
6)Draw the corresponding flow chart.
How algorithm & flowchart help you to write
program??
Algorithm Flow chart Program to be needed
You know the steps? Analyze the problem Scanf(“”%d%d”,&No1,&No2)
1. Read No1, No2
2.
Read No1,No2
3.