A pronic number is a number that is the product of two consecutive integers. For example, the number 6 is a pronic number because it is the product of 2 and 3 (2 x 3 = 6).
Here is a Python program that uses a for loop and an if statement to print all pronic numbers between 1 and 100:
for i in range(1,101):
for j in range(i,101):
if i*j == i+j:
print(i*j)
This program uses nested for loop to iterate over the range 1 to 100. The outer for loop iterates over the first number and the inner for loop iterates over the second number. For each pair of numbers, it checks if the product of the numbers is equal to their sum. If it is, it prints the product.
This program will print all the pronic numbers between 1 to 100, which are 0, 2, 6, 12, 20, 30, 42, 56, 72, 90.
Alternatively, you could use the math formula for pronic numbers, which is n(n+1) and use one for loop to iterate from 1 to 100 and check if the number is a pronic number using the formula and print the pronic numbers.
for i in range(1,101):
if i*(i+1) < 101:
print(i*(i+1))
This program uses the math formula for pronic numbers, which is n(n+1) and use one for loop to iterate from 1 to 100 and check if the number is a pronic number using the formula and print the pronic numbers.