C
START
INPUTA
INPUTB
INPUTC
Sum - A+B+C
AUG : SUM/3
DISPLAY AVG
C
END
Answers
Answered by
0
#include<stdio.h>
int main()
{
// declare variable
float num1, num2, num3;
float sum, avg;
// take inputs
printf("Enter three Numbers: ");
scanf("%f %f %f",&num1, &num2, &num3);
// calculate sum
sum = num1 + num2 + num3;
// calculate average
avg = sum / 3;
// display entered numbers
printf("Entered numbers are: %.2f, %.2f and %.2f\n",
num1, num2, num3);
// display sum and average
printf("Sum=%.2f\n", sum);
printf("Average=%.2f\n",avg );
return 0;
Output:-
Enter three Numbers: 10 20 30
Entered numbers are: 10.00, 20.00 and 30.00
Sum=60.00
Average=20.00
Enter three Numbers: 1.9 2.5 8.16
Entered numbers are: 1.90, 2.50 and 8.16
Sum=12.56
Average=4.19
Similar questions