Created
September 28, 2013 00:37
-
-
Save CapnKernel/6737072 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 10 REM Length of hypotenuse of triangle | |
| 20 A=3 | |
| 30 B=4 | |
| 40 GOSUB 100 | |
| 50 PRINT "A triangle with sides ", A, " and ", B, " has a hypotenuse of length ", C | |
| 20 A=5 | |
| 30 B=12 | |
| 40 GOSUB 100 | |
| 50 PRINT "A triangle with sides ", A, " and ", B, " has a hypotenuse of length ", C | |
| 60 END | |
| 100 REM Calculate hypotenuse using Pythangorus' Theorem | |
| 110 C=SQRT(A*A+B*B) | |
| 120 RETURN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment