program avetemp C************************************************************** C Prompt user for a temperature. Continue to prompt until they C enter -99. Then tell them the average temperature C************************************************************** real tottemp, count, avetemp print *, 'Enter an temperature (-99 to stop)' read *, temp tottemp = 0.0 count = 0.0 do while (temp .ne. -99) tottemp = tottemp + temp count = count + 1.0 print *, 'Enter an temperature (-99 to stop)' read *, temp end do if(count .eq. 0) then avetemp = temp else avetemp = tottemp / count end if print *, 'The average temperature was ',avetemp stop end