Postlab05_Task1_rfelde - integer :: Num, J integer,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
! Lab #5: Nested Loops and Arrays. ! File: Postlab05_Task1_rfelde.f95 ! Date: 07 February 2008 ! By: Ryan Robert Felde ! rfelde ! Section: 02/01, 11:30, and ENAD 138 ! Team: 16 ! ! ELECTRONIC SIGNATURE ! Ryan Robert Felde ! ! The electronic signature above indicates the program submitted for ! evaluation is my individual work and I have a general understanding ! of all aspects of its development and execution. ! ! A BRIEF DESCRIPTION OF WHAT THE PROGRAM OR FUNCTION DOES program Postlab05_Task1_rfelde implicit none
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: integer :: Num, J integer, dimension(100) :: Fibb Write(*,*)'Input number for which you would like to calculate the Fibonacci number: ' read(*,*) Num Fibb(1) = 1 Fibb(2) = 1 if (Num > 46 ) then write(*,*)'Cannot calculate this Fibonacci number.' stop elseif (Num < 0) then write(*,*)'Cannot calculate this Fibonacci number.' stop else Write(*,*)'1 :', Fibb(1) Write(*,*)'2 :', Fibb(2) do J = 3, Num, 1 Fibb(J) = Fibb(J - 1) + Fibb(J - 2) write(*,*) J,':', Fibb(J) end do end if 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.

Ask a homework question - tutors are online