Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'QBASIC calculator! Made by Prithak Adhikari
- DIM a AS INTEGER
- DIM b AS INTEGER
- top:
- CLS
- PRINT "Welcome to Prithak's Calculator"
- PRINT
- INPUT "Enter the first number"; a
- INPUT "Enter the Mathmatical Operator(+,-,*,/,^,MOD)"; oper$
- SELECT CASE oper$
- CASE "+"
- INPUT "Enter second number"; b
- sum = a + b
- PRINT "Result: "; sum
- INPUT "Would you like to do it again(y/n)"; ch$
- IF ch$ = "y" THEN GOTO top
- IF ch$ = "n" THEN END
- CASE "-"
- INPUT "Enter second number"; b
- diff = a - b
- PRINT "Result: "; diff
- INPUT "Would you like to do this again(y/n)"; ch$
- IF ch$ = "y" THEN GOTO top
- IF ch$ = "n" THEN END
- CASE "*"
- INPUT "Enter second number"; b
- mult = a * b
- PRINT "Result: "; mult
- INPUT "Would you like to d othis again(y/n)"; ch$
- IF ch$ = "y" THEN GOTO top
- IF ch$ = "n" THEN END
- CASE "/"
- INPUT "Enter second number"; b
- div = a / b
- PRINT "Result: "; div
- INPUT "Would you like to d othis again(y/n)"; ch$
- IF ch$ = "y" THEN GOTO top
- IF ch$ = "n" THEN END
- CASE "^"
- INPUT "Enter second number"; b
- expo = a ^ b
- PRINT "Result: "; expo
- INPUT "Would you like to d othis again(y/n)"; ch$
- IF ch$ = "y" THEN GOTO top
- IF ch$ = "n" THEN END
- CASE "MOD"
- INPUT "Enter second number"; b
- modd = a MOD b
- PRINT "Result: "; modd
- INPUT "Would you like to d othis again(y/n)"; ch$
- IF ch$ = "y" THEN GOTO top
- IF ch$ = "n" THEN END
- END SELECT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement