Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void main(){
- char x;
- int total = 0;
- while(0==0){
- printf("Input value : ");
- scanf("%s",&x);
- total = total + atoi(&x);
- printf("Total = %d\n",total);
- }
- }
- =======================
- Outputs :
- Input value : 4
- Total = 4
- Input value : 4
- Total = 4
- Input value : 7
- Total = 7
- Input value : 17
- Total = 72
Add Comment
Please, Sign In to add comment