Computer Science, asked by sharadskn4728, 11 months ago

Write an algorithm to calculate sum of two numbers.

Answers

Answered by gavenpais
1
START
STEP 2 : ACCEPT FIRST NUMBER STEP 3 : ACCEPT SECOND NUMBER STEP 4 : ADD THESE TWO NUMBERS STEP 5 : DISPLAY RESULT
STEP 6 : STOP
//WRITE AN ALGORITHM TO FIND THE SUM OF THREE NUMBERS.
STEP 1 : START
STEP 2 : ACCEPT ALL THREE NUMBERS STEP 3 : ADD ALL THREE NUMBERS AND STORE IN ONE VARIABLE
STEP 4 : DISPLAY THE RESULT
STEP 5 : STOP
//WRITE AN ALGORITHM TO FIND THE AREA OF RECTANGLE.
STEP 1 : START
STEP 2 : ACCEPT THE W OF RECTANGLE STEP 3 : ACCEPT THE H OF RECTANGLE STEP 4 : Area = w × h
STEP 5 : DISPLAY STEP 6 : STOP
Circle
Area = π × r2 Circumference = 2 × π × r
Triangle
Area = 1⁄2 × b × h b = base
h = vertical height
Sector
Area = 1⁄2 × r2 × θ
r = radius
θ = angle in radians
Answered by Anonymous
1

An algorithm to calculate the sum of 2 numbers is given below:

Step 1 : Read the Value of X and Y as entered by the user.

Step 2 : Calculate the sum of the 2 numbers using the formula SUM = X + Y

Step 3 : Print the SUM on the screen.

Step 4 : End.

The code for the same is:

X = int(input("Enter X")

Y = int(input("Enter Y")

Sum = X + Y

print( Sum )

Similar questions