Anda di halaman 1dari 2

//WRITE AN ALGORITHM TO FIND THE Write an algorithm to find the largest

SUM OF TWO NUMBERS. among three different numbers entered by


user.
STEP 1 : START
Step 1: Start
STEP 2 : ACCEPT FIRST NUMBER
STEP 3 : ACCEPT SECOND NUMBER Step 2: Declare variables a,b and c.
STEP 4 : ADD THESE TWO NUMBERS
STEP 5 : DISPLAY RESULT Step 4: If a>b
STEP 6 : STOP
If a>c
//WRITE AN ALGORITHM TO FIND THE
SUM OF THREE NUMBERS. Display a is the largest

Else
STEP 1 : START
STEP 2 : ACCEPT ALL THREE NUMBERS
Display c is the largest
STEP 3 : ADD ALL THREE NUMBERS AND
STORE IN ONE VARIABLE Else
STEP 4 : DISPLAY THE RESULT
STEP 5 : STOP If b>c

//WRITE AN ALGORITHM TO FIND THE Display b is the largest


AREA OF RECTANGLE.
Else
STEP 1 : START
Display c greatest
STEP 2 : ACCEPT THE W OF RECTANGLE
STEP 3 : ACCEPT THE H OF RECTANGLE Step 5: Stop
STEP 4 : Area = w × h

STEP 5 : DISPLAY

STEP 6 : STOP
OR
Step 1: Start
Circle
Area = π × r2 Step 2: Declare variables a,b and c.
Circumference = 2 × π × r
Step 4: If a>b && a>c then goto step 7
Triangle othervise goto step 5
Area = ½ × b × h
b = base Step 5: if b>a && b>c then goto step 8
h = vertical height othervise goto step 6

Sector Step 6: print c is greater goto step9


Area = ½ × r2 × θ
r = radius Step 7: print a is gresater goto step9
θ = angle in radians
Step 8: print b is greater goto step9

Step 9: stop

Anda mungkin juga menyukai