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
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
Hello, my name is G Krishna. I'm Creating this blog for the students who are beginners.
Learn More →
Thanks sir
ReplyDeleteWelcome
Delete