Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class sum
- {int a;
- public: sum(int aa):a(aa) {}
- int proc1 ();
- int proc2 ();
- };
- int sum:: proc1()
- {
- if (floor(a)==a) return (a);
- else return (0);
- }
- int sum:: proc2()
- { int m=0, k=a;
- while (k > 0)
- {
- m= m + a%10;
- k= k/10;
- }
- return(m);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement