- #1
suezxc6
- 11
- 0
Summary:: so I am trying to compile this program and i keep on getting "Unterminated character constant beginning at (1)" and "invalid character in name" at the months section. what do i have to change to fix it?
thanks
<Moderator's note: code tags added>
thanks
Fortran:
program Lab6
implicit none
character*9 month
integer monthNum, pos
character*108 months
months = "January February March April &
&May June July August &
&SeptemberOctober November December "
print*, "Enter the month name"
read*, month
pos = index(months,month)
if (pos .eq. 0) then
print*, "The month is invalid"
else
monthNum = pos/9 + 1
! process day
print*, month, " is month #", monthNum
print*, "now process day"
end if
stop
end
Last edited by a moderator: