Computer Science, asked by naaakuyeaaddy1516, 11 months ago

write an algorithm to calculate the average of three numbers

Answers

Answered by Kritikupadhyay5pbh
3

Answer:

step 1: get the input of three real numbers and store in a,b,c

step 2: calculate sum <- a + b + c

step 3: calculate avg <- sum / 3

step 4: print sum and avg

Explanation:

#include <stdio.h>

main()

{

float a, b, c, sum, avg;

printf("\nEnter value of three numbers: ");

scanf("%f %f %f", &a, &b, &c);

sum = a + b + c;

avg = sum / 3;

printf("\nSum = %.2f", sum);

printf("\nAverage = %.2f", avg);

getch();

}

IF you satisfied with my answer so mark me as BRAINLIEST.

Answered by 248001
1

Step 1 -- Start

Step 2-- Read N1 ,N2, N3

Step 4-- Sum =N1 + N2 + N3

Step5 -- Print average

Step6-- Stop

Similar questions