Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a,b;
- cout << "Enter A: ";
- cin >> a;
- b=a;
- int sum=0;
- while(abs(b>0)){
- sum+=b%10;
- b/=10;
- }
- if (a * a == sum * sum * sum) {
- cout << "Yes, A*A equals to cube of sum of digits of A." << endl;
- } else {
- cout << "No, A*A is not equal to cube of sum of digits of A." << endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment