Thursday, 8 November 2012

Prime Number.


# Check the given number is prime or Not???
count=0
num=input('Enter Any +ve Integer: ')
for i in range(1,num+1):
    if num%i==0:
        count=count+1
if count==2:
    print num , 'is Prime Number....'
else:
    print num, 'is Not Prime Number.....'

No comments:

Post a Comment