Skip to main content

PRONIC NUMBER

https://traffboost.net?ref=193631 TraffBoost.NET

PRONIC NUMBER




import java.util.Scanner;
class pronic_number
{
    public static void main(String args[])
    {
        Scanner s= new Scanner(System.in);
        int num,ans=0;
        System.out.println(" Enter a number ");
        num=s.nextInt();
        for(int i=0;i<num;i++)
        {
            if(i*(i+1)==num)
            {
                ans=1;
                break;
            }
        }
        if(ans==1)
        System.out.println(" Entered number is a pronic number ");
        else
        System.out.println(" Entered number is not a pronic number ");
    }
}