Computer Science, asked by priyansunath8976, 3 months ago

Neon(9) (9*9=81) (8+1=9) Java program​

Answers

Answered by kamalrajatjoshi94
1

Answer:

Program:-

import java.util.*;

public class Neon

{

public static void main(String args[ ])

{

Scanner in=new Scanner(System.in);

int n,a=0,s=0,num=0;

System.out.println("Enter the number");

n=in.nextInt();

num=n;

n=n*n;

while(n!=0)

{

a=n%10;

s=s+a;

n=n/10;

}

if(s==num)

System.out.println("It is a neon number");

else

System.out.println("It is not a neon number");

}

}

Similar questions