Computer Science, asked by anumittiwari, 1 year ago

write a program to check whether square root of a number is prime or not in Python programming​

Answers

Answered by Arianagrande69
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 kalpitag
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