Code is copied!
Program To Print Pronic Number JAVA
Write a Program to print whether the inputted number is Pronic or not.
[ A number is said to be a pronic number if product of two consecutive integers is equal to the number, is called a pronic number. Example : 12 = 3x4, 42 = 6x7]
import java.util.*; class pronic { public static void main(String args[]) { Scanner sc = new Scanner (System.in); int n = sc.nextInt(); int flag = 0; for (int i =0; i< n;i++) { if(i *(i + 1)== n) { flag = 1; break; } } if (flag == 1) { System.out.println("It is pronic no"); } else { System.out.println("It is not pronic no"); } } }