write a c program to calculate Avarage 3
numbers by using scanf
Answers
Answered by
1
Explanation:
#include<studio.h>
int main(){
int avg, n, i,sum=0;
printf ("enter the no. of element");
scanf("%d",&n);
for(i = 0; i < n; ++i)
{
printf("%d. Enter number: ", i+1);
scanf("%d", &num[i]);
sum += num[i];
}
average = sum / n;
printf("Average is:", average);
return 0;
}
Similar questions