Advertisement
Guest User

Untitled

a guest
Dec 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. class sum
  2. {int a;
  3. public: sum(int aa):a(aa) {}
  4.  
  5. int proc1 ();
  6. int proc2 ();
  7. };
  8.  
  9. int sum:: proc1()
  10. {
  11. if (floor(a)==a) return (a);
  12. else return (0);
  13.  
  14. }
  15. int sum:: proc2()
  16. { int m=0, k=a;
  17. while (k > 0)
  18. {
  19. m= m + a%10;
  20. k= k/10;
  21. }
  22. return(m);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement