Answer :

Answer:

STEP 1: isPronicNumber() determines whether a given number is the Pronic number or not.

Define a boolean variable flag and set its value to false.

Use for loop to iterate from 1 to given number and check whether i * (i + 1) is equal to the given number, for any value of i.

If a match is found, then set the flag to true, break the loop and returns the value of the flag.

STEP 2: To display all Pronic numbers between 1 and 100,

Start a loop from 1 to 100, and make a call to isPronicNumber() method for each value from 1 to 100.

If isPronicNumber() returns true which signifies that number is Pronic, then display that number

Other Questions