RAJIBRAJU

3

Jun 21st, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.24 KB | None | 0 0
  1. #include<stdio.h>
  2. int main ()
  3. {
  4.     int n,temp,digit,sum=0;
  5.     scanf("%d",&n);
  6.     temp=n;
  7.     while (n>0)
  8.     { digit= n%10;
  9.     sum=sum+digit;
  10.     n=n/10;
  11.  
  12.     }
  13. printf("sum of given numbers=%d\n",sum);
  14.  
  15.  
  16.  
  17.     return 0;
  18. }
Add Comment
Please, Sign In to add comment