Header Ads

Python Program to Find Number is Prime Or Not Using While Loop


What is Prime Number?
A number that is greater than One and divisible only by 1 and itself
For Example:  2, 3, 5,7,11,13,17, 19……..



Example: Code Program


num = int(input("Enter Nuber:"))
i =
2
f = -1
while i < num:
   
if num%i == 0:
        f = f+
1
   
i = i+1
if f == -1:
   
print(num, "is Prime Number")
else:
   
print(num, "is Not Prime Number")

Output:

Python, Program,Find,  Prime, Number,While, Loop, prime number, find prime number, number is Prime, not prime number, Python Program, Find Prime Number Using While Loop, 
Python Program to Find Prime Number ,Python Program to Find Prime Number Using While Loop

Java Program Code

Java Program to Find Number is Prime Or Not

No comments

Powered by Blogger.