Advertisement
whitesurge

C Program #2 Broken

Aug 30th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.62 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <math.h>
  4. #include <stdlib.h>
  5.  
  6. int main()
  7. {
  8.    
  9.     int a = 0;
  10.     int b = 0;
  11.     int c = 0;
  12.     int d = 0;
  13.     int e = 0;
  14.    
  15.  
  16.     scanf("Enter the 1st number %d /n", &a);
  17.    
  18.     printf("Enter the 2nd number ");
  19.     scanf("%d /n", &b);
  20.    
  21.     printf("Enter the 3rd number ");
  22.     scanf("%d /n", &c);
  23.    
  24.     printf("Enter the 4th number ");
  25.     scanf("%d /n", &d);
  26.    
  27.     printf("Enter the 5th number ");
  28.     scanf("%d /n", &e);
  29.    
  30.     int res = (a + b + c + d + e)/5;
  31.     printf("The average of all the numbers is %d", res);
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement