fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int n,r,sum=0;
  7. cout << "enter any no" << endl;
  8. cin >> n;
  9.  
  10. int sq=n*n;
  11. while(sq!=0)
  12. {
  13. r=sq%10;
  14. sq=sq/10;
  15. sum=sum+r;
  16. }
  17. if(sum==n)
  18. cout << "neon no" << endl;
  19. else
  20. cout << "not a neon no" << endl;
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
enter any no
not a neon no