C Program to find the square root of a real number
real::a
write(*,*)'Input the number:'
read(*,*)a
if (a.ge.0.0)then
c=sqrt(a)
write(*,10)c
10 Format(2x,'The square root of the number is',f16.4)
else
d=sqrt(-a)
write(*,20)d
20 Format(2x,'The square root of the number is i',f16.4)
end if
end
real::a
write(*,*)'Input the number:'
read(*,*)a
if (a.ge.0.0)then
c=sqrt(a)
write(*,10)c
10 Format(2x,'The square root of the number is',f16.4)
else
d=sqrt(-a)
write(*,20)d
20 Format(2x,'The square root of the number is i',f16.4)
end if
end
Comments
Post a Comment