write a program to check whether square root of a number is prime or not in Python programming
Answers
Answered by
16
Answer:
Explanation:
How to check a number is prime or not in Python?
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:
Matk as brainlist ✌✌✌✌
Answered by
8
Explanation:
Write a short program to check weather square root of a number is prime or not Ans CLASSES
mum=int(input("enter a number="))
import math
a= int(math sqrt(mum))
b=0
for i in range(2,a):
if a%i==0:
b= b+1
if b==0
print(a, "is a prime number")
else:
print (a,"is not prime number")
If any problem with the answer refer to the photo above:-
Attachments:
Similar questions
Math,
6 months ago
History,
6 months ago
Social Sciences,
6 months ago
Math,
1 year ago
Biology,
1 year ago
Hindi,
1 year ago
Computer Science,
1 year ago