Sunday, 19 August 2018

11-C Program - 13

# program 13
def prim(x):
    l=0
    for y in range(2,x,1):
        r=x%y
        if r==0:
            l=1
            break
   
    if l==1:
        print("The given number x is not a prime")
    else:
        print("The given number x is a prime")

#main program 
x= int(input("Enter the number"))
print("x value=",x)
prim(x)

2 comments: