write a program in bluej to accept a number and check if it is a pronic number or not
reverse of number=original number is a pronic number
example 121=121
fast need to do project
Answers
Answered by
1
Answer:
Explanation:
import java.util.Scanner;
public class Example13 {
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.print("Input a number : ");
int num = sc.nextInt();
int ans = 0;
for(int i=0; i<num; i++)
{
if(i*(i+1) == num)
{
ans = 1;
break;
}
}
if(ans == 1)
System.out.println("Pronic Number.");
else
System.out.println("Not a Pronic Number.");
}
}
Similar questions