Fortran Simple program in Fortran, I get an error

AI Thread Summary
The discussion revolves around a user attempting to learn Fortran by solving problems from a specific website. They share their code for a temperature conversion program but encounter an error due to incorrect syntax in incrementing the variable C. The user realizes that they need to use the correct assignment statement (C = C + 1) instead of just C + 1. After correcting this, they face a new issue related to permission denied when trying to execute the program, indicating a potential file permission problem in their Ubuntu environment. The user expresses confidence in resolving this new issue.
fluidistic
Gold Member
Messages
3,928
Reaction score
272
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.
 
Technology news on Phys.org
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!
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Replies
4
Views
2K
Replies
17
Views
6K
Replies
5
Views
5K
Replies
3
Views
2K
Replies
16
Views
2K
Back
Top