Click Here to see the problem detail.

Solution

Read the problem carefully & see source code.

Source Code
#include<stdio.h>
int main()
{
    int C,N,n,m,grade[1000],i,count;
    double sum,average,output;
    scanf("%d",&C);
    while(C--)
    {
         sum=0;
          i=0;
          count=0;
         scanf("%d",&N);
         m=N;
         n=N;
         while(N--)
         {
             scanf("%d",&grade[i]);
             sum+=grade[i];
             i++;
 
         }
         average=sum/m;
         i=0;
         while(m--)
         {
              if(grade[i]>average)
              count++;
                  i++;
         }
         output=(double)count*100/n;
         printf("%.3lf%\n",output);
 
    }
    return 0;
}

 


Next Previous