Subject: Computer Science
Loop is a statement which executes one or more lines of code in certain number of times. The loop ends with the false condition. Every loop statement requires the following terms:
If...GOTO LOOP
This program use IF----GOTO to create a loop.
x= 10
start:
Print x
x= x+1 ( This adds 1 to x)
If x < 15 Then GOTO start
Output
10
11
12
13
14
For.....NEXT
It is the count controlled loop which knows how many times the loop is to be executed. The loop is executed with the loop control variable at initial value to final value and values in between.
WHILE....WEND
It is a loop statement that executes a series of statements in a loop as long as the given statement is true.
An array is a special type of variable with an unique name, size and type. In another words, an array is a data structure that stores multiple values of similar type with a common name bu having different subscript. An array is defined by using DIM statement. There are two types of array:
DIM
Syntax: DIM [ array name] [ value ]
Example:DIM kul (5)
The branching statement is decision making statement, depending upon the decision it can change the order of execution.
IF......THEN Statement
It helps the computer to check whether the relation is TRUE or FALSE.
Syntax: Line Number IF ( relational expression) THEN n where n is a line number or an instruction. If the expression is true then n will be executed otherwise statement following IF..THEN statement will be executed.
IF....THEN....ELSE
It is a decision making statement as it decides the path of the program.
Syntax: If (Condition) ...THEN (Line number or instruction) .....ELSE (Line number or instruction)
IF_ _ _ _ _ ELSEIF Statement
Syntax: IF ( Condition ) THENStatement-1ELSEIF (Condition) THENStatement-2ELSEIF (Conditon) THENStatement-ELSEStatement-4ENDIF
SELECT-CASE Statement
Syntax: SELECT CASE ( expression )
Statement-1
Case ( expression )
Statement-2
Case ( expression )
Statement-3
Case ELSE
Statement-4
END SELECT
Numeric functions are the type of library function which are used to process numeric or string data and always returns numeric value.
Some numeric functions are as follows:
© 2019-20 Kullabs. All Rights Reserved.