answersLogoWhite

0

What is a sub programs in qbasic?

Updated: 9/21/2023
User Avatar

Wiki User

11y ago

Best Answer

Sub programs allow you to break up one long program; into being a series of much smaller tasks; usually, controlled by a main program. Example...

====

As you can see from the above 2 examples; the 2nd example, although longer, creates code that is much clearer and simpler to read. Even non-programmers should be able to figure out what the 'Main Program' section is doing.

NOTE: There are certain rules for the use of sub-routines. Such as the sub routine should confine itself to doing just 'one' task at a time. So, SUB clearScreen...does just 'one' job, alone...which is to (CL)ear the output (S)creen. It does NOT clear the screen AND get the user to input a number. This makes it quicker and easier to debug programs; as you know exactly where the code is going wrong; so, for example, if the screen didn't clear, properly...then, look at the Sub-routine called: SUB clearScreen. If the title didn't appear; then, look at the Sub-routine called: SUB printTitle. /-Etc.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is a sub programs in qbasic?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you do Qbasic programs?

type: PRINT "I like chocalate!"


Why is QBasic called QuickBasic?

Qbasic and Quickbasic are not the same! Qbasic was a free interpreter that Microsoft included with MS-DOS. Although Quickbasic uses similar syntax as quickbasic it allows programs to be compiled.


What extension would a file saved in Qbasic have?

the extensions of qbasic are that, there are only 80 pixels to write in the qbasic


Why are rem statements important in qbasic programming?

qbasic is important because its technology


Why won't QBasic work on Windows Vista?

Many DOS applications simply will not run under Windows Vista, and none under the 64-bit version. Making the NTVDM support DOS programs in Vista was an extremely low priority, since very few people actually run DOS programs anymore. You can use QBasic and other DOS programs on Vista (even the 64-bit version) by using an emulator known as DOSBox.


What is the shortcut key for input statement in QBasic?

There is no shortcut key of input in qbasic


What are the difference between gwbasic and qbasic?

Difference between QBASIC and GWBASIC?


What are the different types of operators in QBASIC?

The different types of operators in QBASIC are:Arithmetic OperatorsRelational OperatorsLogical Operators


Who found QBASIC?

microsoft


Do you need statement numbers in QBASIC?

Statement numbers were a feature of BASIC, and while QBASIC supports them, they are by no means necessary.


Advantage of qbasic?

The advantage of qbasic is that it is easy to learn, to start out,then one can move on to more complex, or advanced languages.


How do you use the start menu?

Move the mouse pointer until it rests on the start icon at the bottom left corner of the screen, and click it with the left mouse button. The start menu will open up. There are small arrows next to several items in the main menu. These arrows indicates that a sub-menu exists. Place your pointer on Programs to open up the Programs sub-menu. The double arrow at the bottom of the programs sub-menu indicate that some programs in the menu are not presently displayed on the screen. Click on the double arrow so that all the programs are shown. Some items in the programs menu, such as Accessories, have sub-menus on their own. You can choose an item in the menu by single clicking on it.