C Program to Find Sum and Average of Elements
This C Program Finds Sum and Average of Elements in an array
#include<stdio.h>
main()
{
float arr[10];
int i;
float sum=0;
float avg;
for(i=0;i<10;i++)
{
printf("Enter Any Number n");
scanf("%f",&arr[i]);
sum=sum+arr[i];
}
avg=sum/10;
printf("SUM IS %fn AVERAGE IS %fn",sum,avg);
}
Recent Comments