Created
December 4, 2012 00:41
-
-
Save vazexqi/4199440 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROGRAM SUBDEM | |
REAL A,B,C,SUM,SUMSQ | |
CALL INPUT( + A,B,C) | |
CALL CALC(A,B,C,SUM,SUMSQ) | |
CALL OUTPUT(SUM,SUMSQ) | |
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SUBROUTINE INPUT(X, Y, Z) | |
REAL X,Y,Z | |
PRINT *,'ENTER THREE NUMBERS => ' | |
READ *,X,Y,Z | |
RETURN | |
END | |
SUBROUTINE CALC(A,B,C, SUM,SUMSQ) | |
REAL A,B,C,SUM,SUMSQ | |
SUM = A + B + C | |
SUMSQ = SUM **2 | |
RETURN | |
END | |
SUBROUTINE OUTPUT(SUM,SUMSQ) | |
REAL SUM, SUMSQ | |
PRINT *,'The sum of the numbers you entered are: ',SUM | |
PRINT *,'And the square of the sum is:',SUMSQ | |
RETURN | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment