fork download
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. int arr[11];
  6. printf("enter ten integer numbers\n");
  7. int i=0;
  8. for(i;i<10;i++)
  9. scanf("%d",&arr[i]);
  10. int sum=0;
  11. float avg;
  12. for(i=0;i<10;i++)
  13. sum=sum+arr[i];
  14. avg=(float)sum/10;
  15. printf("average of ten numbers is %.2f\n",avg);
  16. printf("the numbers which are greater than average are given below:\n");
  17. for(i=0;i<10;i++)
  18. {
  19. if(arr[i]>avg)
  20. printf("%d ",arr[i]);
  21. }
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 4516KB
stdin
Standard input is empty
stdout
enter ten integer numbers
average of ten numbers is -189035552.00
the numbers which are greater than average are given below:
194 0 1179852502 32765 1 0 1224715093 11177 0 0