Advertisement
edutedu

wqewr

Sep 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. int n,s=0,c,f=0,d,s1=0;
  2. cin>>n;
  3. while(s>9)
  4. {
  5. s=0;
  6. while(n!=0)
  7. {
  8. s=s+n%10;
  9. n=n/10;
  10. }
  11. n=s;
  12. }
  13. cout<<s;
  14. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement