Math, asked by radhikagupta13200625, 10 months ago

A Java Program of neon number in Inputstreamreader ​

Answers

Answered by Anonymous
3

import java.io.*;

public class wordnum

{

public static void main(String arg[])throws IOException

{

InputStreamReader reader=new InputStreamReader(System.in);

BufferedReader input=new BufferedReader(reader);

int sum=0;

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

String n1=input.readLine();

int n=Integer.parseInt(n1);

n1=n;

a=n1*n1;

b=a%10;

sum=sum+b;

a=a/10;

sum=sum+a;

if(sum==n)

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

else

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

}

}

#sumedhian ❤❤

Similar questions