C Program to Find Sum and Average of Elements

This C Program Finds Sum and Average of Elements in an array
[cc code=”c”]
#include
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); } [/cc]

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *