Header Ads

Python Program to Print All Prime Numbers in an Interval Using While Loop

In This Program We Learn to Print All Prime Numbers in an Interval Using While Loop in Python


Python,  Program, Find,  Prime, Number, While, Loop, prime number, find prime number, number is Prime, not prime number, Python Program, Python Program to Find Prime Number ,Python Program to Find Prime Number Using While Loop, Python Program to Print All Prime Numbers in an Interval Using While Loop

Example: Code Program

l = int(input("Enter Strating Range:"))
h =
int(input("Enter Ending Range:"))
while l <= h:
    f = -
1
   
j = 2
   
while j <= l/2:
       
if (l%j) ==0:
            f = f+
1
           
j = j + 1
       
else:
            j = j +
1

   
if f == -1:
       
print(l, end=" ")
        l = l +
1
   
else:
        l = l+
1

Output


Python,  Program, Find,  Prime, Number, While, Loop, prime number, find prime number, number is Prime, not prime number, Python Program, Python Program to Find Prime Number ,Python Program to Find Prime Number Using While Loop, Python Program to Print All Prime Numbers in an Interval Using While Loop


Related Video Python 




Java Program Code

Java Program to Print All Prime Numbers in an Interval

No comments

Powered by Blogger.