Programming Examples
Python program to test if given number is prime or not
WAP to test if given number is prime or not.
Solution
a=int(input("Enter Number"))
k=0
for i in range(2,a//2+1):
if a%i==0:
k=k+1
if k<=0:
print(a," is Prime Niumber")
else:
print(a," is not a prime Number")
Output/ Explanation: