Program to print all Pronic numbers between 1 and 100ExplanationIn this program, we need to display all Pronic numbers between 1 and 100. Pronic number The pronic number can be defined as the number which is a product of two consecutive numbers. Mathematically, the Pronic number can be represented as N x (N + 1) To find whether a number n is a Pronic number or not, use for loop to iterate from i = 1 to i = n and check whether i*(i+1) is equal to n for any value of i. Some of the examples of Pronic numbers are 6 = 2 x 3 72 = 8 x 9 Algorithm
SolutionPythonOutput: Pronic numbers between 1 and 100: 2 6 12 20 30 42 56 72 90 COutput: Pronic numbers between 1 and 100: 2 6 12 20 30 42 56 72 90 JAVAOutput: Pronic numbers between 1 and 100: 2 6 12 20 30 42 56 72 90 C#Output: Pronic numbers between 1 and 100: 2 6 12 20 30 42 56 72 90 PHPOutput: Pronic numbers between 1 and 100: 2 6 12 20 30 42 56 72 90 Next Topic# |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India