Computer Science, asked by ahanya49, 5 months ago

Write a program to input a number and test if it is a prime or not​

Answers

Answered by krishnaharichauhan63
0

Answer:

please mark this answer as brainlist and follow me plz

Attachments:
Answered by united05315cr
0

Answer:

PYTHON PROGRAM

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:  

      print(num,"is a prime number")  

         

else:  

  print(num,"is not a prime number")

hope it helps!!!

Similar questions