handout5_solutions

handout5_solutions - solutions.txt Mon Oct 24 10:41:19 2011...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

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

Unformatted text preview: solutions.txt Mon Oct 24 10:41:19 2011 1 1: 2:******************************************* 3:./exercise4/internal4.f90 4: 5:PROGRAM internal4 6: 7: IMPLICIT NONE 8: 9: REAL :: a,b,c ! *** Declare a,b,c=0 10: 11: PRINT*, "Enter number one" 12: READ*,a 13: PRINT*, "Enter number two" 14: READ*,b 15: 16: CALL calc(a,b,c) 17: 18: PRINT (/, "IN MAIN PROGRAM" , " a =" ,f5.2, " b =" ,f5.2, " c=" ,f5.2),a,b,c 19: 20:CONTAINS 21: 22: SUBROUTINE calc(d,e,f) 23: 24: REAL :: d,e,f ! *** Dummy variables 25: 26: f=SQRT(d**2+e**2) 27: PRINT (/, "[1] IN SUBROUTINE " , " a =" ,f5.2, " b =" ,f5.2, " c=" ,f5.2),a,b,c 28: a=d/2 ; b=e/2 ; c=f/2 29: PRINT (/, "[2] IN SUBROUTINE " , " a =" ,f5.2, " b =" ,f5.2, " c=" ,f5.2),a,b,c 30: 31: END SUBROUTINE calc 32: 33:END PROGRAM internal4 34:******************************************* 35: 36: 37:******************************************* 38:./exercise5/internal5.f90 39: 40:PROGRAM internal5 41:! *** Program to demonstrate a function 42: IMPLICIT NONE 43: 44: REAL :: a,b,c ! *** Declare a,b,c 45: 46: PRINT*, "Enter number one" 47: READ*,a 48: PRINT*, "Enter number two"...
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.

Page1 / 2

handout5_solutions - solutions.txt Mon Oct 24 10:41:19 2011...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online