0

The code for if a number is neon? Anyone?

12th Jan 2017, 9:01 PM
akashlina dewanjee
akashlina dewanjee - avatar
3 Réponses
+ 6
I think all don't know about neon number. A neon number is a number where the sum of digits of square of the number is equal to the number.  ex 9 9²=81. 8+1=9 cin>>num no=num*num; while(no!=0) { sum+=no℅10; no/=10; } if(num==sum) cout<<"neon no.";
13th Jan 2017, 9:52 AM
Megatron
Megatron - avatar
+ 1
The atomic number of Neon is 10, it's a noble gas in the periodic table and therefore is in group 18. Inorganic chemistry by Walter White var testElement = 10; var atomicNe = 10; if (testElement == atomicNe){ cout<<"The tested element is Neon"; } else { cout<<"You should be more particular wit your questions!"; } Edit: pardon my ignorance in the matter, I just learned something new :)
13th Jan 2017, 4:03 AM
seamiki
seamiki - avatar
23rd Feb 2018, 11:26 AM
Abhimanyu Gupta
Abhimanyu Gupta - avatar