This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ! increments of three. It also outputs all of the values calculated while the loop was running. program implicit none ! Initialize variables real:: I, Y ! Set up the index to run from -9 to 9 in increments of 3 do I = -9, 9, 3 ! Set conditional statement based on the conditions given and perform calculations based on these. if (I >= 0) then Y = (-3 * (I**2)) + 5 else Y = (3 * (I**2)) + 5 end if ! Write out the value of the index and the function for each iteration of the loop. write(*,*)'t = ', I, ' y(t) =', Y end do stop end...
View Full Document
This note was uploaded on 10/05/2009 for the course ENGR 117 taught by Professor Staff during the Spring '08 term at Purdue University-West Lafayette.
- Spring '08
- Computer Programming