5 m
Question 4.
Write a program to accept a number and check whether it is a prime number.
Ounction
Answers
Answered by
1
Answer:
hi...
Explanation:
n=int(input ("enter the number"))
if n==2:
print("prime")
else:
for i in range(2,n):
if n%i==0:
print("not a prime")
else:
print ("prime")
hope it helps you ☺️
Similar questions
Math,
3 months ago
Math,
3 months ago
Computer Science,
7 months ago
Environmental Sciences,
7 months ago
Physics,
1 year ago
Physics,
1 year ago
English,
1 year ago