Advertisement
yoyo106

Deviation

Mar 5th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int x,y,z,a;
  7.     printf("Enter three numbers: ");
  8.     scanf("%d %d %d",&x,&y,&z);
  9.     a=x+y+z;
  10.     float b,c,d,e;
  11.     b=a/3.0;
  12.     printf("Average=%.02f\n",b);
  13.     c=x-b;
  14.     d=y-b;
  15.     e=z-b;
  16.     printf("Deviation:\n");
  17.     printf("%d \t%.02f\n%d \t%.02f\n%d \t%.02f",x,c,y,d,z,e);
  18.  
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement