Wednesday, January 6, 2021

Class-7 Computer Chapter-9 LOOPING STATEMENT

 EVENTS CONVENT HIGH SCHOOL

Computer
Chapter-8
LOOPING STATEMENT
 

A. Tick the correct option

1.Specifying is not compulsory in for next

a.Step(✓)              b.in                  c.next

 2.The variable used to specify a number of times a loop is executed

a.Next              b.for                c.control(✓)

 3.Gives back the control to while

a.Do (✓)          b.wend                         c.for

 4.Music can be played by using the instruction

a.Play               b.music            c.both a and b(✓)

 5.Increments the control variables and send the control back to for

a.Step               b.Next (✓)             c.Wend

  

B. Fill in the blanks

    1.      repeat command is used if we want to repeat a set of commands are fixed number of times in a program

 2.      Loop variable is used to specify how many times a loop is executed.

 3.      A s i i characters "\a" can create a beep sound when printed.

 4.      Control variable statement is used to increase or decrease the value of a control variable

 5.      In the for next loop control variable is assigned initial value and a  final value .

 

C tight T for true and F for false statements:-

1. We prefer not to use looping in our program because they increase our program [false]

 2. We can use only one control variable say c in three nested loops [false]

 3. WEND is used with a FOR clause [false]

 4.there cannot be more than 9 nested loops within one loop [True]

 5.the value of step should never be made negative to avoid in finite loops [True]

  

D.Answer the following questions:-

1. What do you understand by looping explain  

Ans-1In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached. Typically, a certain process is done, such as getting an item of data and changing it, and then some condition is checked such as whether a counter has reached a prescribed number.

2. What is a for next loop ?

Ans. The for... next statement is an iterative, incremental loop statement used to repeat a sequence of statements for a specific number of occurrences. ... This looping continues until the ending condition is met or the loop is explicitly exited with an exit or goto statement.

3. Why is step statement used in for next?

Ans-3 You can use For...Next statements to repeat a block of statements a specific number of times. For loops use a counter variable whose value is increased or decreased with each repetition of the loop.

4.What is a nested loop?

Ans-4  nested loop is a loop within a loop, an inner loop within the body of an outer one. How this works is that the first pass of the outer loop triggers the inner loop, which executes to completion. Then the second pass of the outer loop triggers the inner loop again. This repeats until the outer loop finishes.

 

 

 

No comments:

Post a Comment

Thank your for your valuable responce.
Mrfarooqui