I need some help in generating pair of numbers in orders using FORTRAN code.
The order is like following.
loop_1: 1,2 2,3 3,4 4,5 5,6 6,7 7,8 ..... until <= 2000
loop_2: 1,3 3,5, 5,7 7,9 9,11 11,13 ........until <= 2000
loop_3: 1,4, 4,7 7,10 10,13 13,17 ..... until <= 2000
loop_4: 1,5 5,9 9,13 13,17 17,21 .... until <= 2000
. . . . until loop_100:
I have tried with simple code such as
program loopJump
implicit none
!
integer :: i,j,k
do k = 1, 6
do i = 1, 5
j=(i+k)
print*, i," ",j
enddo
enddo
stop
end
Hi, just for your kind information, the code which post here is not homework but is part of my 200 line code for calculate time auto correlation function of my simulation data.
Anyway, you hint really helped me to write the code and it is running as per my request.
program jumploop
implicit none
!!!!!!!!!!!!!!!!!
integer :: i,j,k,n
do k = 1, 5
do i = 1, 10, k
j = (i+k)
print*, i, j
end do
print*," "
end do
end program jumploop