daily pastebin goal
90%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  using namespace std;
  3. int main()
  4. {
  5.     int a,b;
  6.     cout << "Enter A: ";
  7.     cin >> a;
  8.     b=a;
  9.     int sum=0;
  10.     while(abs(b>0)){
  11.         sum+=b%10;
  12.         b/=10;
  13.     }
  14.   if (a * a == sum * sum * sum) {
  15.     cout << "Yes, A*A equals to cube of sum of digits of A." << endl;
  16.   } else {
  17.     cout << "No, A*A is not equal to cube of sum of digits of A." << endl;
  18.   }
  19.     return 0;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top