Guest User

Untitled

a guest
Jul 15th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void main(){
  5.     char x;
  6.     int total = 0;
  7.  
  8.     while(0==0){
  9.         printf("Input value : ");
  10.         scanf("%s",&x);
  11.         total = total + atoi(&x);
  12.         printf("Total = %d\n",total);
  13.     }
  14.  
  15. }
  16.  
  17.  
  18. =======================
  19.  
  20.  
  21. Outputs :
  22.  
  23.  
  24. Input value : 4
  25. Total = 4
  26. Input value : 4
  27. Total = 4
  28. Input value : 7
  29. Total = 7
  30. Input value : 17
  31. Total = 72
Add Comment
Please, Sign In to add comment