Notice that the CPU is not an I/O device. It constantly deals with data as it follows the instructions of your program, but is not a source of data for your program nor a destination of data from your program.
INPUT
Statement
QBasic uses the INPUT
statement to input data from the
keyboard.
Here is a program that asks the user for a number,
then prints out that number times two:
' Double a Number ' PRINT "Type a number" 'Ask the user for a number INPUT NUMBER 'Get it from the keyboard, put it in NUMBER PRINT NUMBER * 2 'Print the number times two. END
Here is how this program looks in the QBasic window:
These statements will execute one by one in sequence. To run the program push "shift-F5" or use the menu "alt-R, S" (as usual).
What is the first thing the program writes to the monitor