Go Back
BASIC PROGRAMMING LANGUAGE
Meaning of BASIC

BASIC is an acronym for Beginner’s All-purpose Symbolic Instruction Code.
It is a high-level programming language that was designed to help beginners learn how to write computer programs easily.

BASIC was developed in 1964 by John Kemeny and Thomas Kurtz at Dartmouth College in the United States of America.


Meaning of a Programming Language

A programming language is a set of instructions and rules used to communicate with a computer.
It allows the user to write commands that tell the computer what to do.

A program is a set of instructions written in a programming language to perform a specific task.





Types of Programming Languages

Programming languages are generally divided into two main types:

  1. Low-Level Languages
    These are languages that are close to the machine’s language (binary or assembly).
    They are difficult for humans to understand but easy for computers to execute.
    Examples:

    1. Machine language

    2. Assembly language

  2. High-Level Languages
    These are languages that are close to human languages.
    They are easier to learn and understand.
    Examples:

    1. BASIC

    2. FORTRAN

    3. COBOL

    4. C

    5. Python

    6. Java



History of BASIC

BASIC was created in 1964 at Dartmouth College.
It was designed to make programming simple for students who were not science majors.
Over time, many versions of BASIC have been developed, such as:

  1. GW-BASIC

  2. QBasic

  3. Visual BASIC



Features of BASIC Programming Language
  1. It is easy to learn and use, especially for beginners.

  2. It uses simple English-like commands.

  3. It is a high-level language.

  4. It allows interactive programming (the user can type and run commands directly).

  5. It can run on many types of computers.

  6. It supports mathematical and logical operations.

  7. Programs written in BASIC are readable and understandable.



Uses of BASIC Programming Language
  1. It helps you to learn the logic of programming.

  2. It helps you to develop small applications.

  3. It helps you to perform mathematical calculations.

  4. It helps you to understand how computers process instructions.

  5. It is used in teaching computer programming concepts in schools.



BASIC Character Set

The character set of BASIC refers to all the symbols, letters, and digits that can be used when writing BASIC programs.

The BASIC character set includes the following:

  1. Alphabets: All uppercase (A–Z) and lowercase (a–z) English letters.

  2. Digits: The numbers 0–9 used to represent numeric values.

  3. Special Characters: Symbols such as +, -, *, /, =, <, >, (, ), ;, :, " " and others used for operations and punctuation.

  4. White Spaces: Spaces, tabs, and blank lines used to separate words or improve readability.

  5. Reserved Words (Keywords): Special words that have predefined meanings in BASIC, such as PRINT, INPUT, LET, IF, THEN, FOR, NEXT, GOTO, REM, and END.

  6. Strings: A sequence of characters enclosed in quotation marks, for example "HELLO" or "SUM = ".

  7. Operators: Symbols used for performing operations, such as:
    Arithmetic Operators: +, -, *, /
    Relational Operators: =, <, >, <=, >=, <> (not equal)
    Logical Operators: AND, OR, NOT





Structure of a BASIC Program

A BASIC program is made up of lines of statements.
Each line usually begins with a line number followed by an instruction (statement).

For example:

10 INPUT A
20 INPUT B
30 LET C = A + B
40 PRINT C
50 END

Explanation:

  1. Line 10: Asks the user to input the first number.

  2. Line 20: Asks the user to input the second number.

  3. Line 30: Adds the two numbers and stores the result in C.

  4. Line 40: Displays the result.

  5. Line 50: Ends the program.



Common BASIC Statements/Commands and Their Functions

Statements in BASIC are the instructions that tell the computer what to do. Every BASIC program is made up of one or more statements written in a specific order. Each statement normally starts with a line number.

CommandMeaning / Function
REMUsed to write remarks or comments in a program. Example:
10 REM This program adds two numbers
INPUTUsed to accept data from the user. Example:
20 INPUT A
LETUsed to assign a value to a variable. Example:
30 LET C = A + B
PRINTUsed to display results on the screen. Example:
40 PRINT C
ENDMarks the end of the program. Example:
50 END
IF...THENUsed for decision making. Example:
60 IF A > B THEN PRINT "A is greater"
FOR...NEXTUsed for loops (repeating actions). Example:
FOR I = 1 TO 10: PRINT I: NEXT I
GOTOUsed to jump to another line in the program. Example:
70 GOTO 20


Rules for Writing BASIC Programs
  1. Each statement usually begins with a line number.

  2. Line numbers should increase in order (for example: 10, 20, 30...).

  3. The program should begin with INPUT statements (if needed).

  4. The program should end with an END statement.

  5. Use LET to perform assignments.

  6. Use PRINT to display results.

  7. Use REM for comments to explain what each part of the program does.


Example Program 1: Addition of Two Numbers

10 REM Addition of two numbers
20 INPUT A
30 INPUT B
40 LET C = A + B
50 PRINT "The sum is "; C
60 END

Explanation: The program accepts two numbers and prints their sum.


Example Program 2: Finding the Area of a Rectangle

10 REM Area of a rectangle
20 INPUT L
30 INPUT B
40 LET A = L * B
50 PRINT "Area = "; A
60 END

Example Program 3: Finding the Average of Three Numbers

10 REM Average of three numbers
20 INPUT A
30 INPUT B
40 INPUT C
50 LET SUM = A + B + C
60 LET AVG = SUM / 3
70 PRINT "Average = "; AVG
80 END

Example Program 4: Checking if a Number is Positive or Negative

10 REM Check positive or negative
20 INPUT N
30 IF N > 0 THEN PRINT "Positive"
40 IF N < 0 THEN PRINT "Negative"
50 IF N = 0 THEN PRINT "Zero"
60 END


Advantages of BASIC Programming Language
  1. It is very simple and easy to learn.

  2. It uses English-like words.

  3. It allows immediate testing of programs.

  4. It helps beginners understand programming easily.

  5. It runs on many different computer systems.



Disadvantages of BASIC Programming Language
  1. It is slow in execution compared to modern languages.

  2. It is not suitable for complex programs.

  3. It is an old language and not widely used for modern applications.

  4. It requires more lines of code to perform simple tasks.




Versions of BASIC
  1. Dartmouth BASIC (original version)

  2. GW-BASIC

  3. QBasic

  4. Visual BASIC (VB)

  5. FreeBASIC


Summary

  1. BASIC stands for Beginner’s All-purpose Symbolic Instruction Code.

  2. It is a high-level programming language.

  3. It was developed by John Kemeny and Thomas Kurtz in 1964.

  4. BASIC uses simple English-like instructions.

  5. It is mainly used for teaching programming.




CHECK OTHER RELATED TOPICS HERE


  1. COMPUTER ETHICS

  2. SAFETY MEASURE IN USING COMPUTER


  3. GRAPHICS PACKAGES



TELL US YOUR VIEWS





VIEWS







Reach us on whatsapp
Email Us