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
Chemistry,
2 months ago
English,
2 months ago
Computer Science,
5 months ago
Environmental Sciences,
5 months ago
Physics,
9 months ago
Physics,
9 months ago
English,
9 months ago