Skip to content

Commit

Permalink
feat: added Neon/NeonNumber.java
Browse files Browse the repository at this point in the history
  • Loading branch information
mayankch283 committed Oct 15, 2023
1 parent a864741 commit 52cd7d8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Neon/NeonNumber.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
public class NeonNumber
{
public static void main(String[] args)
{
int n,square,sum=0;

//command line input
n = Integer.parseInt(args[0]);

//calculate square.
square=n*n;

while(square>0)
{
sum=sum+square%10;
square=square/10;
}
//condition for checking sum is equal or not.
if(sum==n)
System.out.println("Its a Neon number.");
else
System.out.println("Its not a Neon number.");
}
}

0 comments on commit 52cd7d8

Please sign in to comment.