Advertisement
Guest User

sum and average

a guest
May 19th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int a,b,sum=0;
  5.     float avrg=0;
  6.     printf("Enter two values: ");
  7.     scanf("%d%d",&a,&b);
  8.  
  9.     sum=a+b;
  10.     printf("summation = %d\n",sum);
  11.  
  12.     avrg=(float)sum/2;
  13.     printf("Average = %0.2f\n",avrg);
  14.  
  15.  
  16.  
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement