Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int array[10];
- int i;
- float average=0;
- int x=0;
- int sum=0;
- int c=0;
- printf("Enter 10 integers:");
- for(i=0;i<10;i++)
- {
- scanf("%d",&array[i]);
- sum=sum+array[i];
- c++;
- average=(float)sum/c;
- }
- for(i=0;i<10;i++)
- {
- if(array[i]>average)
- x++;
- }
- printf("%d are integer highr than average\n",x);
- printf("average:%.2f \n",average);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment