Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- main( )
- {
- int num; /*many semi colon errors, declaration errors, in the last printf the variables weren't defined, or were wrong*/
- int sum = 0;
- int status, I, thing;
- printf("Please enter an integer to be summed ");
- printf("(q to quit): ");
- status = scanf("%d", &num);
- if(status=1) /*I like if statements better*/
- {
- printf("Please enter next integer (q to quit): ");
- thing=scanf("%d", &I);
- if (thing=1)
- {
- sum = I + num;
- printf("Those integers %d and %d sum to %d.\n", num, I, sum);
- return;
- }
- else if (thing=o)
- break;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment