Code Below:


import java.util.*;
class pronic
{
    public static void main()
    {
        Scanner s=new Scanner(System.in);
        int n,i,c=0;
        System.out.println("enter a no.");
        n=s.nextInt();
        for (i=1;i<=n;i++)
        {
            if (i*(i+1)==n)
            c++;
        }
        if (c>0)
        System.out.println(n+"is pronic");
    }
}