Neon Number is a number whose sum of digits of it’s square is equal to the original number.
Example 1: 9. 92 = 81. 8+1=9. We observe that the sum of digits of the square of original number is equal to the original number. Hence it is a Neon Number.
Example 2: 11. 112 = 121. 1+2+1 = 4. Here the sum of digits of the square of original number is not equal to the original number. Hence it is not a Neon Number.
C
#include <stdio.h>
void main()
{
int n=0,r=0,s=0,nCopy=0;
printf("Enter a number: ");
scanf("%d",&n);
nCopy=n;
n=n*n;
while(n>0)
{
r=n%10;
s=s+r;
n=n/10;
}
if(s==nCopy)
{
printf("%d is a Neon Number",nCopy);
}
else
{
printf("%d is not a Neon Number",nCopy);
}
}C