Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int main()
- //Average of four numbers
- {
- int a,b,c,d,sum;
- float avg;
- printf("Enter four numbers : \n");
- scanf(" %d %d %d %d",&a,&b,&c,&d);
- sum=a+b+c+d;
- avg=(float)sum/4;
- printf("sum=%d\n",sum);
- printf("Average =%.2f",avg);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement