QBasic Tutorial 2 - Printing Math - QB64




In Tutorial 1, we saw that PRINT was capable of printing text surrounded by quotes. PRINT is capable of doing a bit more. PRINT is capable of printing calculations too.

QBasic / QB64 follows the math rule of PEMDAS - Please Excuse My Dear Aunt Sally. PEMDAS is also called the Order of Operations.
Parentheses
Exponents
Multiplication
Division
Addition
Subtraction

Functions Used in This Tutorial 
SQR is the square root function.
ABS is the absolute function.

Code Download 
QBT2.BAS




QBasic / QB64 Links



QB64 is a free download at www.qb64.org

QB64 Wiki & Manual is found at www.qb64.org/wiki/Main_Page

QBasic 1.1 is found within OldDOS.exe.
OldDos is a free download at download.microsoft.com/download/win95upg/tool_s/1.0/W95/EN-US/olddos.exe

On some web browsers, the Microsoft link does not work, because the download comes as an exe file. A zip file of OldDOS can be found at www.pcxt-micro.com/download.html

QBasic 1.1 needs DOSBox to run on Windows Vista and greater, Mac, and Linux.
DosBox is a free download at www.dosbox.com

Free QB64/QBasic Code 

QBasic.Net - www.qbasic.net

Pete's QBasic Site - www.petesqbsite.com/index.php

QB45 - qb45.org

Phatcode - games.phatcode.net