write a C program to read 5 integer numbers from the keyboard and display their sum and average
please tell fast
Answers
Answered by
2
int a,b,c,d,e,sum,avg;
printf("enter a,b,c,d and e values ");
scanf("%d %d %d %d %d", &a,&b,&c,&d,&e);
sum = a+b+c+d+e;
avg = sum/5;
printf("sum = %d", sum);
printf("average = %d",avg);
output:
enter a,b,c,d and e values 2 3 4 5 6
sum = 20
average = 4
Answered by
1
Answer:
#include<stdio.>
void main()
{
int a,b,c,d,e;
scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
printf("Sum :%d Average :%d",a+b+c+d+e,(a+b+c+d+e)/5);
}
HOPE IT WILL HELP YOU!!!
Similar questions