An algorithm to find the average of three numbers?

Dear student,

Below is the algorithm to find the average of three numbersStep 1: Take the three numbers  a, b, c.Step 2: Find the sum of three numbers  a+b+c.Step 3: Divide the sum obtained in step 2 by the number of terms i.e. 3that is a+b+c3This the the average of three numbers.

Regards
 

  • 1
Dear divesh
Program:

10 ? ? REM Program to find average and sum of three numbers
20? ? ?INPUT ?Enter the first number: ? ; X
30? ? ?INPUT ?Enter the second number: ? ; Y
40? ? ?INPUT ?Enter the third number: ? ; Z
50? ? ?LET SUM = X + Y + Z
60? ? ?AVG = SUM/3
70? ? ?PRINT ?Sum of three numbers is: ? ; SUM
80 ? ? PRINT ?Average of three numbers is: ? ; AVG
90? ? ?END

-Algorithm:

STEP 1? ? ?START
STEP 2? ? ?INPUT X,Y,Z
STEP 3? ? ?COMPUTE SUM = X + Y + Z
STEP 4? ? ?COMPUTE AVG = SUM/3
STEP 5? ? ?PRINT SUM
STEP 6? ? ?PRINT AVG
STEP 7? ? ?END

Hope this helps you
  • 0
What are you looking for?