write python program to print prime number between any two number m to n
# Python program to display all the prime numbers between m and n
m=int(input("Enter value of m:"))
n=int(input("Enter value of n:"))
print("Prime numbers between", m, "and", n, "are:")
for i in range(m, n + 1):
# all prime numbers are greater than 1
if i > 1:
for r in range(2, i):
if (i % r) == 0:
break
else:
print(i)
Comments
Leave a comment