Saturday, 17 September 2011

Constants

Every computer program user different commands keywords,constants and Variables.In this part we will choose we will discuss about Constants and variables.

Constants
Constants are actual value of numbers,characters and their combinations which can be used in BASIC language.

There are two types:

1.Numeric constants 
2.String constants

 Numeric Constants:
Its a positive or negative fixed number that can be assigned to a variable.

Example: 511-1976+25.90


10 Let A=511     
20 Let S=1976    
30 PRINT A+B  


In this statement 511 and 1976 are NUMERIC CONSTANTS  



STRING CONSTANTS
we can write any  combination of characters .enclosed in quotes in string constants.

EXAMPLE:   LAHORE
10 LET A= 1947 
20 LET BS= PAKISTAN
30 PRINT B$was created in A 

Here 1947 is a Numeric Constant and Pakistan is a string constant.  
 

No comments:

Post a Comment