Write a program to show that the number is prime or composite in python
Answers
Answered by
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
Computer Science,
5 months ago
Math,
5 months ago
Math,
5 months ago
Social Sciences,
11 months ago
Hindi,
11 months ago
English,
1 year ago
Physics,
1 year ago
Math,
1 year ago