-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathYT55.java
More file actions
37 lines (30 loc) · 782 Bytes
/
YT55.java
File metadata and controls
37 lines (30 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.io.*;
public class YT55
{
public static void main(String[] args)throws IOException
{
int n;
int p=0, flag=0;
InputStreamReader I = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(I);
System.out.println("Enter the number which you want to check? ");
n=Integer.parseInt(br.readLine());
for(int i=1; i<=n; i++)
{
p=i*(i+1);
if (p==n)
{
flag=1;
break;
}
}
if (flag==1)
{
System.out.println("Pronic Number");
}
else
{
System.out.println("NOT");
}
}
}