Skip to content

Commit

Permalink
A number is perfect square or not
Browse files Browse the repository at this point in the history
  • Loading branch information
Arijit-SE committed Feb 20, 2023
1 parent 44d8ab5 commit 1b7c010
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions PerfectSquareOrNot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import java.util.*;
public class PerfectSquareOrNot {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
double res = Math.sqrt(num);
if((int)res == res)
{
System.out.println("Perfect Square");
}
else
{
System.out.println("Not a perfect square");
}
}
}

0 comments on commit 1b7c010

Please sign in to comment.