티스토리 뷰

노트/Fortran 연습

Program 4.1. 곱셈표의 출력

Jae-seong Yoo 2014. 4. 27. 16:16
PROGRAM Multiplication_Table
!---------------------------------------------------------------------------------
!	Program to calculate and display a list of products of two numbers.
!	Variables used are:
!		M, N	 				: the two numbers being multiplied
!		PROD				: their product
!		Last_M, Last_N	: the last values of M and N
!
!	Input		: Last_M and Last_M, the largest numbers to be multiplied
!	Output	: List of products M * N
!---------------------------------------------------------------------------------

	IMPLICIT NONE
	INTEGER :: M, N, Last_M, Last_N, Product
	
	PRINT *, "Enter the last values of the two numbers :"
	READ *, Last_M, Last_N
	PRINT *, "M   N   M*N"
	PRINT *, "============"
	
	DO M = 1, Last_M
		DO N = 1, Last_N
			Product = M * N
			PRINT *, M, "   ", N, "   ", Product
		END DO
	END DO
	
	pause
END PROGRAM Multiplication_Table




 
 

'노트 > 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.2. 온도 변환 (2nd Version)  (0) 2014.03.23
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