An easy Pronic Number Program
Pronic Number Program: solved Java program for ICSE Class 9 Computer Applications with complete BlueJ code, explanation and sample output.
It is a number which is the product of two consecutive integers, that is, a number of the form n(n + 1).
For Example: 12 is a pronic number because it is a result of -> 3*(3+1) =3*4= 12
For other number related programs check the given link
Unleashed: Important Number Programs for ICSE Part-1
Write a program to accept a number and check whether the number is a pronic number or not.
import java.io.*;
class pronic //the product of consecutive integers e.g., 72, 110
{
public static void main()throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out .println("Enter a number");
int num=Integer.parseInt(br.readLine());
int ans=0;
for(int i=0;i<num;i++)
{
if(i*(i+1)==num)
{
ans=1;
break;
}
}
if(ans==1)
{
System.out.println("It is a pronic number");
}
else
{
System.out.println("It is not pronic number");
}
}
}Output:
Enter a number
12
It is a pronic number
Watch the video to learn more about java
https://www.youtube.com/watch?v=QZKcULOC4lg
Related Posts
Continue learning with these related articles

String Methods in Java for ICSE Class 10: 25 Output Questions with Answers
ICSE Class 10 Computer Applications practice on String class methods: length, charAt, indexOf, lastIndexOf, substring, replace, trim, compareTo, equals and more, with 25 board-style output questions and step-by-step answers.

Special Number Programs in Java for ICSE: Armstrong, Spy, Neon, Disarium, Pronic and More
Every special number asked in ICSE Computer Applications – prime, perfect, Armstrong, palindrome, automorphic, neon, spy, Niven, duck, buzz, Disarium, special and pronic numbers – with definitions, examples and one complete Java program that checks them all.

Math Library Methods in Java for ICSE Class 9 (with Outputs)
ICSE Class 9 Computer Applications notes on the Java Math class: sqrt, cbrt, pow, abs, max, min, ceil, floor, round, rint and random, with return types, tricky negative-number outputs and Java expressions for formulas.