Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main () {
- int tmp;
- int sumatotal=0;
- /*
- do{
- printf("Dame 1 numero\n");
- scanf("%d",&tmp);
- getchar();
- if(tmp>=0){
- sumatotal+=tmp;
- }
- }while(tmp>=0);
- */
- printf("Dame 1 numero\n");
- scanf("%d",&tmp);
- getchar();
- while(tmp>=0){
- sumatotal+=tmp;
- printf("Dame 1 numero\n");
- scanf("%d",&tmp);
- getchar();
- }
- printf("Sumatotal = %d\n",sumatotal);
- getchar();
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement