handout9_solutions

handout9_solutions - solutions.txt Fri Dec 16 12:39:35 2011...

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: solutions.txt Fri Dec 16 12:39:35 2011 1 1: 2:******************************************* 3:./exercise2/example_case.f90 4: 5:PROGRAM example_case 6: 7: IMPLICIT NONE 8: 9: INTEGER :: i 10: 11: PRINT*, "Enter an INTEGER" 12: READ*,i !*** Get the user to input i 13: 14: !**** CASE construct NOTE overlapping of ranges in case-selector is 15: !**** NOT permitted. Therefore ORDERING is NOT important 16: 17: SELECT CASE (i) 18: CASE (2) 19: PRINT*, "Integer = 2" 20: CASE (7) 21: PRINT*, "Integer = 7" 22: CASE (3:6) 23: PRINT*, "Integer is greater than 2 an less than 7" 24: CASE (8:10) 25: PRINT*, "Integer is greater than 7 and less than 11" 26: CASE DEFAULT 27: PRINT*, "No Match" 28: END SELECT 29: 30:END PROGRAM example_case 31: 32:******************************************* 33: 34: 35:******************************************* 36:./exercise1/example_if.f90 37: 38:PROGRAM example_if 39:!** 40:!** First Piece of code to demonstrate the importance 41:!** of ordering and the allowed overlapping of the test ranges...
View Full Document

This note was uploaded on 02/13/2012 for the course MATH 5806 taught by Professor Brooks during the Fall '10 term at Minnesota.

Ask a homework question - tutors are online