AR13


TEST CASE 1 

INPUT
5
1 2 3 4 5
OUTPUT
3.00

TEST CASE 2 

INPUT
6
1 2 5 41 23 1
OUTPUT
12.17

#include <stdio.h>

float findMean(int A[], int N)
{
  float m,sum=0;
  int j;
  for(j=0;j<N;j++)
  {
    sum=sum+A[j];
  }
  m=sum/N;
  printf("%.2f",m);
}
int main() {
int n;
  scanf("%d",&n);
  int a[n],i;
  for(i=0;i<n;i++)
  {
    scanf("%d",&a[i]);
  }
  findMean(a,n);
 return 0;
}

Comments

Popular posts from this blog

AR1

SER12

AR15