learning-to-code/qb64/cascading-numbers2.bas

30 lines
1.1 KiB
QBasic

REM Cascading numbers 2.0
REM by John Paul Wohlscheid
REM ask for numbers
PRINT "Please enter twn numbers and watch the values cacade"
INPUT "Enter your first number: "; num1%
INPUT "Enter your second number: "; num2%
INPUT "Enter your third number: "; num3%
INPUT "Enter your fourth number: "; num4%
INPUT "Enter your fifth number: "; num5%
INPUT "Enter your sixth number: "; num6%
INPUT "Enter your seventh number: "; num7%
input "Enter your eighth number: "; num8%
INPUT "Enter your ninth number: "; num9%
INPUT "Enter your tenth number: "; num10%
ab% = num1% - num2%
cd% = num3% - num4%
ef% = num5% - num6%
gh% = num7% - num8%
ij% = num9% - num10%
finalnum% = ab% - cd%
REM displaying numbers while using str$ to convert numbers to strings
CLS
PRINT STR$(num1%) + " " + STR$(num2%) + " " + STR$(num3%) + " " + STR$(num4%) + " " + STR$(num5%) + " " + STR$(num6%) + " " + STR$(num7%) + " " + STR$(num8%) + " " + STR$(num9%) + " " + STR$(num10%)
PRINT " " + STR$(ab%) + " " + STR$(cd%) + " " + STR$(ef%) + " " + STR$(gh%) + " " + STR$(ij%)
PRINT "=========================================================="