Hi! I'm new here and a few days ago I have started to program in Fortran. I used Fortran 5 years ago in my university but now I have a problem. I use codebloks and when I compile this text I have this error: Symbol 'Square' cannot have a type. I don't understand why? There is anyone can help me?
This is the code:
program square_2
implicit none
integer :: i
integer, dimension (-5:5) :: number, square
do i= -5, 5
number(i) = i !Initialize number
square(i) = number(i)**2 !Calculate square
end do
do i= -5, 5
write (*,100) number(i), square(i)
100 format (1X, 'Number = ', I6, ' Square = ', I6)
end do
pause
end program square_2
This is the code:
program square_2
implicit none
integer :: i
integer, dimension (-5:5) :: number, square
do i= -5, 5
number(i) = i !Initialize number
square(i) = number(i)**2 !Calculate square
end do
do i= -5, 5
write (*,100) number(i), square(i)
100 format (1X, 'Number = ', I6, ' Square = ', I6)
end do
pause
end program square_2