Programming Examples
Python program to check whether square root of a given number is prime or not
WAP to check whether square root of a given number is prime or not.
Solution
import math
n=int(input("Enter a number "))
m=int(math.sqrt(n))
k=0
for i in range(2,m//2+1):
if m%i==0:
k=k+1
if k==0:
print(m,", which square root of ",n," , is Prime Number.")
else:
print(m,", which square root of ",n," , is NOt Prime Number.")
Output/ Explanation: