Computer Science, asked by braininfinity1145, 11 months ago

Write a program to show that the number is prime or composite in python

Answers

Answered by Khghj
0

Answer:See this example:

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

Explanation:

Similar questions