gfortran: declare an array
program arrayProg
real :: numbers(5) !one dimensional real array
integer :: matrix(3,3), i , j !two dimensional integer array
!assigning some values to the array numbers
do i=1,5
numbers(i) = i * 2.0
end do
!display the values
do i = 1, 5
Print *, numbers(i)
end do
!assigning some values to the array matrix
do i=1,3
do j = 1, 3
matrix(i, j) = i+j
end do
end do
!display the values
do i=1,3
do j = 1, 3
write(*,*) matrix(i,j)
end do
end do
!short hand assignment
numbers = (/1.5, 3.2,4.5,0.9,7.2 /)
!display the values
do i = 1, 5
write(*,*) numbers(i)
end do
end program arrayProg
Also in C#:
- unity custom update
- add row and columns to grid wpf in code
- unity cancel invokerepeating
- csharp first element of array
- convert word files to plain text c#
- get what week of the month c#
- c# map
- multidimensional meaning
- use enter key unity
- or in unity
- reverse a string in c#
- downlaod file and use C#
- what is using static in c#
- sending email using c#
- c# loop through object
- convert array object to int[] c#
- quaternion euler
- Instantiate c#
- c# lambda expression
- validating file upload asp.net core mvc
- ihttpactionresult to object c#
- unity random float
- degree to radians c#
- switch case c# contains