Skip to main content

Program to find whether a number is perfect square or not

C      Program to find whether a number is perfect square or not
        write(*,*)'Enter the number:'
        read(*,*)x
        y=sqrt(x)
        if (x.eq.y**2)then
        write(*,*)'The number is a perfect square.'
        else
        write(*,*)'The number is not a perfect square.'
        endif
        end

Comments