How To Print Prime Numbers
#PRIME NUMBERS
print('PRIME NUMBERS')
n=int(input('\nEnter Number till which Prime Numbers are needed :-'))
x=' '
for i in range(2,n+1):
prime=1
for j in range(2,i):
if(i%j==0):
prime=0
break
if(prime==1):
x=x+str(i)+' '
print ('\nThe Prime Numbers between 0 to',n,'are =',x)
Made By :-
Nilay Saraf
Comments
Post a Comment