Home for the Programmer, Webmaster and Bloggers

14 November 2018

GETTING STARTED WITH QBASIC AS A BEGINNER


Image result for qbasic


Most Federal and State Institutions in Nigeria offering Computer Science with few departments are introduced into Basic which they call “QBASIC”. This programming language in a High Level Language, it is easy to learn and  it is in a English like form. QBasic can written on a translator which most called Compiler, QBasic operate on Interpreter. You can search on google,com to download interpreter for QBasic.


Most of you might be wondering how does coding in QBasic interpreter looks like:


Get the Interpreter and load it.


You write code in the blue environment, Let write little QBasic code on how to add two numbers.


Before that you must understand VARIABLE, VARIABLE Name, Data Types and rules guiding them. You can search that and read that up.




10      CLS


20      REM “Program to add two numbers”


30      num1, num2 as INTEGER


40      result as DOUBLE


50      LET num1 = 19


60      LET num2 = 30


70      result = num1 + num2


80      PRINT result




The output will display the answer in black environment


49


Explanation:


The numbers you at the left side in called Number Line use to navigate from on position when using GOTO statement.


CLS means clear the screen, it helps to clear the screen if there was previous program run on the screen.


REM means comment, to render some text useless to the interpreter and it use in documentation.


LET is use to assign value, it is not compulsory to use it in some cases


INTEGER is a data type


DOUBLE is a data type that accumulate decimal value


PRINT as the name sounds, it is use to display output.


 <a
href="https://nnu.ng/nip/?a=gurudeen" target="_blank"><img
src="https://nnu.ng/sitefiles/ads/1532112859.jpg" /></a>
                  


Thanks, hope it was useful. Drop your comment below

No comments:

Post a Comment