Computer Science, asked by supriyaroy0314, 1 month ago

write a python program to check whether a number is prime or not​

Answers

Answered by Anonymous
5

Answer:

  • num = int(input("Enter a number: "))
  • if num > 1:
  • for i in range(2,num):
  • if (num % i) == 0:
  • print(num,"is not a prime number")
  • print(i,"times",num//i,"is",num)
  • break.
  • else:
Answered by harshvirsing55
16

\huge\blue{\mid{\underline{\overline{\tt Answer :-}}\mid}}

\small\orange{\boxed{PROGRAM} }\small\green{\boxed{IN} }\small\orange{\boxed{PYTHON} }\small\green{\boxed{LANGUAGE} }

n=int(input("Enter your number :"))

if n>1:

   for i in range (2,n):

       if n%i==0:

           print(n,"is NOT a Prime Number.")

           break

   else:

       print(n,"is a Prime Number.")

\orange{\tt Hope it will} \green{\tt help you.}

Similar questions