part1b - END DO READ(10)value...

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

View Full Document Right Arrow Icon
PROGRAM part1b IMPLICIT NONE INTEGER::ierror, n, value, i CHARACTER::choice IF(ierror /=0) STOP "Error opening file: fibo.dat" DO DO WRITE(*,*) "Which number of the fibonacci sequence would you like to find?" READ(*,*)n IF(n<1 .OR. n>40) THEN WRITE(*,*) "Please enter a number within 1 and 40" ELSE EXIT END IF END DO DO i=1,n READ(10,*)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: END DO READ(10,*)value WRITE(*,'(A,I2,A,I8/////)')"Value #",n," in the fibonacci sequence is: ", value DO WRITE(*,*)"Would you like to find another value in the fibonacci sequence?" READ(*,*) choice IF(choice=='n' .OR. choice=='N') THEN STOP ELSE IF(choice=='y' .OR. choice=='Y') THEN REWIND(10) EXIT ELSE WRITE(*,*)"PLease enter yes or no" END IF END DO END DO END PROGRAM...
View Full Document

This note was uploaded on 07/22/2010 for the course MAE 112 taught by Professor Freeh during the Spring '10 term at North Country Community College.

Ask a homework question - tutors are online