write a c program to find the average of n numbers passing/using the array
Answers
Answered by
0
# include < stdio.h >
int main( )
{
int a[25], n, i ;
float mean = 0, sum = 0 ;
printf(" Enter the Numbers of terms: ") ;
scanf("%d ",& n) ;
printf("\n Enter the Numbers : \n") ;
for ( i = 1 ; i < = n ; i++)
{
scanf("%d ",& a[i]) ;
}
for ( i = 1 ; i < = n ; i++)
{
sum = sum + a[i] ;
avg = sum / n ;}
printf("\n Mean of entered Numbers are : %f ",mean) ;
return ( 0 ) ;
}
output is in photo.
mark me as brainliest
Attachments:
Similar questions