Guest User

Untitled

a guest
Jun 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.64 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. main( )
  4. {
  5.     int num;                    /*many semi colon errors, declaration errors, in the last printf the variables weren't defined, or were wrong*/
  6.     int sum = 0;
  7.     int status, I, thing;
  8.     printf("Please enter an integer to be summed ");
  9.     printf("(q to quit): ");
  10.     status = scanf("%d", &num);
  11.    
  12.        
  13.    
  14.     if(status=1)            /*I like if statements better*/
  15.     {
  16.         printf("Please enter next integer (q to quit): ");
  17.         thing=scanf("%d", &I);
  18.         if (thing=1)
  19.         {
  20.         sum = I + num;
  21.         printf("Those integers %d and %d sum to %d.\n", num, I, sum);
  22.         return;
  23.         }
  24.         else if (thing=o)
  25.             break;
  26.     }
  27.    
  28.        
  29.         return 0;
  30. }
Add Comment
Please, Sign In to add comment