C Program to test whether a number is positive or not
write(*,*)'Input the number:'
read(*,*)n
if (n.eq.0)then
write(*,*)'The entered number is zero.'
else if (n.gt.0)then
write(*,*)'The entered number is positive.'
else
write(*,*)'The entered number is negative.'
end if
end
write(*,*)'Input the number:'
read(*,*)n
if (n.eq.0)then
write(*,*)'The entered number is zero.'
else if (n.gt.0)then
write(*,*)'The entered number is positive.'
else
write(*,*)'The entered number is negative.'
end if
end
Comments
Post a Comment