PROGRAM Temperature_Conversion_2
!---------------------------------------------------------------------------------
!	Program to convert a temperature on the Celsius scale to the
!	corresponding temperature on the Fahrenheit scale.
!	Variables used are:
!	Celsius		: temperature on the Celsius scale
!	Fahrenheit : temperature on the Fahrenheit scale
!
!	Input		: Celsius
!	Output 	: Fahrenheit
!---------------------------------------------------------------------------------
	
	IMPLICIT NONE
	REAL :: Celsius, Fahrenheit

	!	Obtain Celsius temperature
	PRINT *, "Enter temperature in degrees Celsius:"
	READ *, Celsius

	!	Calculate corresponding Fahrenheit temperature
	Fahrenheit = 1.8 * Celsius + 32.0

	!	Display temperature
	PRINT *, Celsius, "degrees Celsius =", & 
	Fahrenheit, "degrees Fahrenheit"

	pause
End PROGRAM Temperature_Conversion_2


 

 

'노트 > Fortran 연습' 카테고리의 다른 글

Program 3.5. 이진 반가수기  (0) 2014.04.06
Program 3.4. 오염지수 3  (0) 2014.04.06
Program 3.3. 오염지수 2  (0) 2014.04.06
Program 3.2. 오염지수  (0) 2014.04.06
Program 3.1. 이차 방정식  (0) 2014.04.06
Program 2.Exercise6.1. 온도 변환 (1st Version)  (0) 2014.03.23
Program 2.Exercise5  (0) 2014.03.23
Program 2.1. 발사체 문제  (0) 2014.03.22
Program 1.Exercise10  (0) 2014.03.22
Program 1.1. 방사성 물질 감쇠  (0) 2014.03.22

+ Recent posts