Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main ()
- {
- int n,temp,digit,sum=0;
- scanf("%d",&n);
- temp=n;
- while (n>0)
- { digit= n%10;
- sum=sum+digit;
- n=n/10;
- }
- printf(" given numbers=%d\n",temp);
- printf("sum of given numbers=%d\n",sum);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement