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


CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz