Hey guys,(adsbygoogle = window.adsbygoogle || []).push({});

I'm new to fortran and I'm having a slight problem. I put my code below as reference. I first set up a my known values. Then I used an equation to solve for v. After I solve for v I then computed c which involves v.

What I'm now trying to do is to loop the value I got for c back into the equation [c=((r*t)/(p+(a/(v**2))))+b]. So the c would become v and compute a new number.

Any ideas on how I could accomplish that? Thanks for help in advance.

Code (Text):program homework

open (2, file='output.txt')

a=366*10**3

b=0.0429

p=100

t=300

r=8.3145

DO 1, i=0,5

v=(r*t)/p

c=((r*t)/(p+(a/(v**2))))+b

write(2,*) c

1 continue

end program

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Fortran Help (Do Loop)

**Physics Forums | Science Articles, Homework Help, Discussion**