Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  .c
Language: C/C++
Code:
#include<stdio.h>
int main()
{
    int i,n,arr[20],sum=0;
    float mean=0;
    printf("nenter the no. of elements in the array");
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
    printf("narr[%d]= ",i);
    scanf("%d",&arr[i]);
    }
        for(i=0;i<n;i++)
sum+=arr[i];
mean=(float)sum/n;
printf("n the sum of array elements=%d",sum);
printf("n mean of array =%.2f",mean);
return 0;
}
          
Comments: