Skip to main content

SQUARES.F95

	PROGRAM SQUARES
!
! Purpose: To initialize and display a one-dimensional array.
!
	IMPLICIT NONE
	INTEGER I
!  Define the array and initialize it as specified in the question.
	INTEGER:: IV(10)=(/1,2,3,4,5,6,7,8,9,10/)
!
!  Display the elements of IV and their squares.
	DO I=1,10
	  WRITE(*,100)IV(I),IV(I)**2
	END DO
!
  100 	FORMAT(I5,2X,I5)
!
	END PROGRAM SQUARES