Question

# Print Neon number in an array.

```				```
A neon number is a number where the sum of digits of square of the number is equal to the number. For example if the input number is 9, its square is 9*9 = 81 and sum of the digits is 9. i.e. 9 is a neon number.
```
```

# Share code with your friends

Code

```				```
import java.util.Scanner;
public class NeonNumberInArray
{
public static void main(String[] args)
{
/* Initialize array */
int [] arr;

int n=0,i=0,squaredNumber=0,a=0,sum=0;
Scanner sc = new Scanner(System.in);

System.out.println("Enter  number of elements in the array");
n = sc.nextInt();
arr=new int[n];
System.out.println("Enter numbers in array");

for(i=0;i< n;i++)
{
arr[i]=sc.nextInt();
}

/* printing Neon elements in an array */
System.out.println("Neon Elements in an array");
for(i=0;i< n;i++)
{
squaredNumber=arr[i]*arr[i];
sum=0;
/*Loop to find the sum of digits.*/
while(squaredNumber!=0)
{
a=squaredNumber%10;
sum=sum+a;
squaredNumber=squaredNumber/10;
}
if(sum==arr[i])
{
System.out.println(arr[i]+" ");
}

}

}
}
```
```

## Coding Store

Sale ### Mastering String

50
Sale 150
Sale 200
Sale ### Mastering Recursion

50
Sale ### Mastering Numbers

50
Sale ### Mastering Matrix

50
Sale ### Mastering Array

50
Sale ### ISC QUESTION PAPERS WITH SOLUTION(PROGRAMMING ONLY)

50
Sale 50