Class-8 Ict Ppt Q-basic
Class-8 Ict Ppt Q-basic
CLS
PRINT 1
PRINT 2
PRINT 3
PRINT 4
....
PRINT 20
END
LOOPING
IN
Q BASIC
Learning Objectives:-
A loop is a sequence of
instruction i.e. continually
repeated until a certain
condition is reached.
Or
A loop is a programming
function that iterates a
statement or condition based
on specified boundaries.
Loops can repeat in two ways:
1. A specific number of
times. FOR...NEXT Loops
CLS
FOR A=1 TO 5 STEP 1
PRINT “ARYAN”
NEXT A
END
WRITE A PROGRAM T DISPLAY THE SUM OF
NUMBER FROM 1 TO 20.
CLS
Sum=0;
FOR A =1 TO 20 STEP 1
SUM =SUM +A
NEXT A
END
DO….WHILE LOOP:
A DO….WHILE loop is used when we
want to repeat a set of statements as long
as condition is true.
Cls
Let x=1
Do while (x<=10)
print “ Happy Mothers
Day”
x=x+1
loop
Write a program to display the sum of all
numbers present between 1 TO 50.
CLS
X=1
Sum=0;
Do while (x<50)
SUM =SUM +x
x=x+1
loop
END
Hands On:
Q1: what is the step value Q1 Answer
of the given source code? The step value is
1(default)
CLS
FOR A = 1 TO 10
PRINT “MUNNA”
NEXT A
CLS
A=1
Do while (A <10 )
PRINT “MUNNA”
loop
Q3 Answer
The loop will execute
infinite time because the
start value and end value
are same
Assessment
Time:5 Min
FM=5
Click Here to get question
HOME WORK
WRITE A PROGRAM TO FIND THE SUM OF
FOLLOWING EXPRESSION USING FOR... NEXT AND
DO WHIL E LOOP.