Page 76 - ModularV1.1 _c7_flipbook
P. 76
C. Write 'T' for true and 'F' for false.
1. The IF-THEN statement is the simplest conditional statement. .....................
2. The statements used to repeat a set of instructions in a
program are called iterative statements or looping statements. .....................
3. The WHILE statement is used to repeat a task for a fixed number of times. .....................
4. While loop is a replacement of the If…Then statement. .....................
5. While…End…While loop is known as a Condition Control loop. .....................
6. BASIC-256 provides two types of looping statements FOR...NEXT and IF-THEN. .....................
D. Short answer type questions.
1. When is the IF-THEN-ELSE statement used?
..........................................................................................................................................................................................
2. Write the syntax of the IF-THEN and IF-THEN-ELSE statements.
..........................................................................................................................................................................................
3. Consider the given program and answer the following questions.
sum = 0
FOR N = 1 TO 30 STEP 3
sum = sum + N
NEXT N
PRINT "sum = " + sum
a. How many times the above loop will run? ............................................................................
b. What will be the output of the above program? ............................................................................
E. Long answer type questions.
1. Draw the flowchart for IF-ELSE statement.
2. What is looping? What are the two looping statements used in BASIC-256?
3. Write the syntax and draw the flowchart of WHILE...END...WHILE loop statement.
F. What will be the output of the following programs?
1. FOR N = 1 TO 10
IF (N = 1 ) THEN
PRINT "I had " + N + " slice of pizza."
ELSE
PRINT "I had " + N + " slices of pizza."
END IF
NEXT N
74 Modular (Ver. 1.1)-VII

