The name QBasic is an acronym for Quick Beginners All Purpose Symbolic Instruction Code. It was developed and launched by Microsoft in the year 1991 and is considered to be one of the most ideal languages for absolute beginners. It was intended as a replacement for GW-BASIC. QBasic was based on earlier QuickBASIC 4.5 compiler. It does not produce .exe files but instead generates files with extension .bas which can only be executed immediately by the built in QBasic interpreter. It is based on DOS operating systems but is also executable on windows.
Beginning with QBasic:
QBasic is available as an open source software.
QBasic consists of two windows:
- Program Window: The window titled as ‘Untitled’ is the program window. It is the place where program/code is written
- Immediate Window: The window below Program Window titled as ‘Immediate’ is the immediate window. This window is used as a debugging tool and is used when the user wants to check the output of a single statement.
Some Basic useful commands on QBasic:
1. PRINT: This command prints the statement or data written after it. If the data to be printed is a string then it is written inside double quotes (” “) and if it is a number or a variable it can be written directly.
PRINT "HELLO GEEKS"
2. INPUT: INPUT command is used to take inputs/data from the user. It can be used to input both strings and numbers.
If the data to be taken is a numerical value then the variable name in which it is to be stored is written directly after the INPUT command.
INPUT "[message to user]"; [variable_name]
If the data to be taken is string then the variable name in which it is to be stored is written followed by $ after the INPUT command.
3. CLS: CLS stands for Clear Screen and is used to clear the screen if some previous results/outputs are present on the screen.
Below is a simple program to illustrate above commands:
When using INPUT commands, users are presented with the message associated with it and are asked to input values to variables.
PRINT statement prints the statements associated with it.
Applications of Qbasic:
- QBasic is the most suitable language for the beginners to start with. It introduces people to programming without any need to worry about the internal working of the computer.
- QBasic is very easy and simple to apply and create business applications, for creating games and even simple databases. It offers commands like SET, CIRCLE, LINE, etc which allow the programmer to draw using Qbasic. Hence, graphics can also be created using QBasic.
- QBasic also supports creating sounds of some desired frequency through the speakers of your PC. Though only one sound can be played at once.
Advantages of QBasic:
- The key feature of the language is its close resemblance to English.
- Syntax of your code is checked automatically.
- Qbasic has a dynamic program debugging feature.
- Lengthy programs can be broken into smaller modules
Disadvantages of QBasic:
- The language is not structured.
- Qbasic is DOS based and has now become obsolete and is limited only in the field of education and programming.
- 6 Ways Artificial Intelligence Will Change Education in the 2020s
- Types of Models in Object Oriented Modeling and Design
- Proof of Stake (PoS) in Blockchain
- What is Bipolar Disorder and How Can Artificial Intelligence Help in Detecting it?
- 13 Study Tips For Students - Smart Work is the Key of Success
- How Does YouTube Store And Analyze Such Huge Amount of Data?
- Cybersecurity Challenges In Digital Marketing - Take These Steps To Overcome
- Challenges Faced By IoT in Agricultural Sector
- Geeks Coding Challenge [GCC 2019] - A Three Day Coding Challenge By GeeksforGeeks
- Social Engineering - The Art of Virtual Exploitation
- Computer Science 101
- How Emerging Economies and Different Industries are Getting Benefit From Cloud Computing?
- 7 Steps to Getting Started With IoT
- How to perform wordpress security auditing?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.