I'm not too sure that I understand exactly what you mean by 'add a square'...?! Thus, I will attempt to answer the question using multiple different ways; hoping that, least, 'one' of these answers might be right...
==>
CLS
PRINT "PROGRAM: Twelve Times Tables Number Square"
FOR intTimes% = 1 TO 12
FOR intTables% = 1 TO 12
sum% = intTimes% * intTables%
noOfSpaces% = 0
IF LEN(STR$(sum%)) = 2 THEN noOfSpaces% = 2
IF LEN(STR$(sum%)) = 3 THEN noOfSpaces% = 1
PRINT sum%; SPC(noOfSpaces%);
NEXT
NEXT
END
<==
...QBASIC Code/End.
Chat with our AI personalities
USING STRING LITERAL VALUES TO ADD 2 NUMBERS
If you just want to show the outcome of two numbers you have:
PRINT 4 + 5
This will print '9' the answer to 4 + 5.
If you want to show the addition:
PRINT "4 + 5 = "; 4 + 5
This will show the question and then calculate the answer.
If you want the user to input numbers to add, use variables and then add them the same way.
======
COLLECTING USER INPUT FROM THE KEYBOARD/USING NUMERIC VARIABLES
In the following example, the end user can get to interact with the program by typing in their numbers at the keyboard; then, pressing the [Enter] key.
CLS
PRINT "PROGRAM: Add 2 numbers"
INPUT "Enter the 1st number: ", number1
INPUT "Enter the 2nd number: ", number2
sumTotal=number1+number2
PRINT "The sum total is: "; sumTotal
INPUT "Again, Y/N"; yesNo$
IF UCASE$(LEFT$(yesNo$,1))="Y" THEN RUN
END
======
CREATE FUNCTION/THEN, MAKE A FUNCTION CALL TO ADD 2 NUMBERS
Another way to write this program is to create a function/then, make a function call...
'*** PROGRAM: Add 2 numbers...
'*** Variable declaration list...
number1=7 '...initialise numeric variable 1
number2=3 '...initialise numeric variable 2
'*** Main program...
CLS '...(CL)ear the (S)creen
PRINT add(number1,number2) '...make function call/passing in 2 numbers to add
END '...END of program/halt program code execution
'*** Function(s)...
FUNCTION add(num1,num2) '...this line marks the start of the Function
add=num1+num2 '...this line returns the sum total of the 2 numbers
END FUNCTION '...this line marks the end of the Function
You need a code that can run to print even numbers between 10 and 100 using the qbasic command.
the two types of data used in Qbasic is numeric data and alpha numeric data.
Cls input "enter two no.s ",a,b sum=a+b print "sum = ";sum end
you do this 10 print "0112358132134" use the whole of the thing
There is no shortcut key of input in qbasic