Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://www.facebook.com/AminproPastebin
- #include <stdio.h>
- int main()
- {
- int x =0;
- int matrix[10];
- float avg=0;
- int total=0;
- int mostpos = 0;
- printf("Enter 10 intergers: ");
- while(x<10){
- scanf("%d", &matrix[x]);
- x ++;
- }
- x = 0;
- while(x<10){
- total = total + matrix[x];
- x ++;
- }
- avg = total/10;
- printf("Average : %.2f\n", avg);
- x =0;
- while(x<10){
- total = matrix[x];
- x ++;
- if(total > avg){
- mostpos ++;
- }
- printf("%d integer is larger than the average.\n", mostpos);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement