Control Structures in BASIC (GW-BASIC) – Programming

Control Structures in BASIC (& GW-BASIC):

Control structures control the flow of execution of a program.

-Types of Control Structures in BASIC:

There are three types of control structures in BASIC, which are:

*Sequence
*Selection
*Loop

*Sequence Structure:

In sequence structure, the instructions are executed according to the increasing order of their line numbers.

For example, I made this program to explain more about sequence structure:

Sequential structure

Sequential structure at GW-BASIC emulator by RajasTutorials.com

In GW-BASIC, during the execution of a program, the program control can be transferred from one part of the program to another conditionally of unconditionally. GW-BASIC provides statements for both types of transfer of control:

1) Unconditional transfer of control:

In unconditional transfer of control, the program control switches to a specific line by skipping one or more lines without any condition at all.

2) Conditional transfer of control:

InΒ conditional transfer of control, the program control switches to a specific line by skipping one or more lines depending on a certain condition.


β€œMy posts/articles/images are not allowed to be stolen/copied anywhere at Cyber space. Doing so will allow me to take a legal action against the copier.”

Related Posts

M.Bakhtiar Zuberi
Hello, I'm M.Bakhtiar Zuberi, the only article poster & owner of this website. Your comments/suggestions are welcomed the most! RajasTutorials.com is a part of 3DPixelz.com network.

3 Comments

  1. Adams J. says:

    Very helpful tutorial! πŸ™‚

  2. Abdullah says:

    Very nice information! Your all GW-BASIC posts are helping me so much! πŸ˜‰

  3. Saima Mehar says:

    Assalam’o’Alaikum
    condition means? which condition?

Leave a Comment

Kindly solve the following puzzle to prove that you\'re not a bot: