Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program temperature
- !write a program that askes for n temperatures, then asks what these
- !n temperatures are in celsius. Then, it prints the average of these
- !temperatures in farenheit
- !write a celsius to farenheit fucntion
- implicit none
- integer:: temperaturesum, J, i, n
- real:: u, y, ctf, ntemp
- integer, dimension(:), allocatable :: temperatures
- ntot=0
- J=0
- print*, "enter number of temperatures"
- read*, ntemp
- allocate(temperatures(ntemp))
- do i=1, ntemp
- J=J+1
- print*, "enter value in celsius"
- read*, temp
- temperaturesum = temperaturesum + n
- y=ctf(temp)
- end do
- u=(ntot/J)
- print*, "mean temp =", u
- print*, "Temp in farenheit=", y
- stop
- end
- real function ctf (a)
- implicit none
- real:: a
- ctf=(a*(9.0/5)+32)
- return
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement