Thread Closed

Simple program in Fortran, I get an error

 
Share Thread Thread Tools
Dec22-09, 07:44 PM   #1
 
Recognitions:
Gold Membership Gold Member

Simple program in Fortran, I get an error


It's not an assignment. Rather I'm trying to learn back some fortran.
I've found a website with some simple problems to do, that's where I got this one. See the first problem of this page : http://www.chem.ox.ac.uk/fortran/.

Here's my program :
Program vasy
implicit none

Integer :: C
Real :: F

C=0
F=0
do while (C<=100)
F=(9./5.)*C+32
C+1
write(*,*)C,F

end do


end program vasy

Here's the error I'm getting : "
C+1
1
Error: Unclassifiable statement at (1)
"
I know I didn't have to set F=0, but I tried several things in case the error was there... I can't get rid of the problem. My compiler is goftran and I'm under Ubuntu.
 
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> Hong Kong launches first electric taxis
>> Morocco to harness the wind in energy hunt
>> Galaxy's Ring of Fire
Dec22-09, 08:48 PM   #2
 
Recognitions:
Gold Membership Gold Member
Nevermine, I just saw my problem. I had to write a=a+1 instead of just a+1.

Now I'm getting a permission denied when executing the program, but I think I'll solve it.
Thanks anyway!
 
Thread Closed
Thread Tools


Similar Threads for: Simple program in Fortran, I get an error
Thread Forum Replies
Simple fortran error Programming & Comp Sci 2
need help about FORTRAN program Mechanical Engineering 7
running a Fortran 77 program in a C++ enviorment/program Programming & Comp Sci 2
Fortran error Programming & Comp Sci 33
help with simple Fortran program Programming & Comp Sci 1