|
|
xxxxxxxxxxxxxxxxxx |
c This program demonstrates the "if - then - else" construction.
c The "if" line ends with "then".
c Also, "else" must go on a line by itself.
program root
real x, y
print *, "What is your number ?"
read *, x
if (x .ge. 0) then
y = sqrt(x)
print *, "The square root of your number is : ", y
else
print *, "Your number has no real square root."
end if
print *, "Bye"
end
|