Programming Pandit

c/c++/c#/Javav/Python


Latest Update

Tuesday, November 17, 2020

Python program to check a number is prime or not by G Krishna Chauhan

Source Code




num=int(input("Enter the number: ")) 

for i in range(2,num): 

    if num%i==0: 

        print(num, "is not prime number") 

        break; 

    else: 

print(num,"is prime number")


OUTPUT


Enter the number: 6

6 is not prime number

Enter the number: 5

5 is prime number


 

2 comments: