c Centigrade to Fahrenheit conversion and vice-versa
c Designed by anonymous.
real c,f
33 write(*,*)'Please select the conversion type'
write(*,*)'a) Centrigrade==>Fahrenheit {Press 1}'
write(*,*)'b) Fahrenheit==>Centrigrade {Press 2}'
read(*,*)i
if(i.EQ.1) then
goto 11
endif
if(i.EQ.2) then
goto 22
endif
stop
11 write(*,*)'Give the temperature value in Centigrade scale'
read(*,*)c
f=c*9.0/5.0+32.0
write(*,*)'The temperature value in Fahrenheit scale is',f
44 write(*,88)
88 format(3x,//,'Would you like to calculate again?',/)
write(*,*)'YES => PRESS 1'
Write(*,*)'NO => PRESS ANYTHING BUT 1'
read(*,*)j
if(j.EQ.1) then
goto 33
endif
stop
22 write(*,*)'Give the temperature value in Fahrenheit scale'
read(*,*)f
c=(f-32.0)*5.0/9.0
write(*,*)'The temperature value in Centigrade scale is',c
goto 44
end
No comments:
Post a Comment