All Tech at one spot
1. Looping:- The process of repeating a series of statements a number of times is known as Looping
2. For…Next:- This loop executes a fixed number of time, from the initial value to the final value.
3. While…Wend:- This loop executes repeatedly till the given condition remains true.
4. Do until loop :- This loop executes repeatedly till the given condition remains false.
5. Nested Loop:- A loop within other loop is called a Nested Loop.
1. The process of repeating a series of statements a number of times is known as Looping
2. The Control Variable will be assigned the Initial at the beginning of the FOR loop.
3.The WEND statement shifts the control to the WHILE statement during the exe of the loop.
4. The increment /decrement of the Control Variable is mentioned inside the body of the Do loop.
5.The value of the Control Variable can be decreased in the For Next loop with the help of the Step statement.
1. Using For Next loop reduces the length of the program. True
2. In the For Next loop, we cannot decrease the value of the Control Variable. False
3. The Condition of the While… Wend loop cannot use relational operators. False
4. Step clause is used with the While…Wend loop. False
5. If the Condition is false at the beginning of the execution of the loop, the While… Wend does not execute at all. True
1. We can use step with this type of loop.
(i)For…Next
(ii) While…Wend
(iii)Do…Until
(iv) All of the above
2. The control variable can be decreased in this type of loop
(i)For…Next
(ii) While…Wend
(iii)Do…Until
(iv) All of the above
3.For the loop For a = 1 to 20 Step 4 the loop will execute _________ number of times.
(i)3
(ii) 4
(iii) 5
(iv) 6
4.If the loop While(x>5) has to execute the initial value can be
(i)x=1
(ii) x=3
(iii)x=5
(iv)x=10
5. The loop will stop excuting when the value of v is ________ for FOR v = 25 TO 10 Step – 4
(i)9
(ii)10
(iii)11
(iv) 12
1. Define looping.
Ans:- The process of repeating a series of statements a number of times is known as Looping.
2. What is the function of the Control Variable in a loop?
Ans:- Control Variable helps to determine the number of times the loop will execute
3. How is Step used in For…Next loop?
Ans:-The Step statement, when used with For, offers the fl exibility of increasing the value of Control Variable by more than 1 and also decreasing the value of the Control Variable.
4. What does Wend do in the While Wend loop
Ans :- Shift the control to the While statement.
5. In a While Wend loop, what happens when the Condition, is false in the beginning of the loop?
Ans :- If the Condition is false at the beginning of the execution of the loop, the While…Wend does not execute at all.
1.Explain the working of For Next loop briefly
Ans :- 1. Determine the Initial Value and Final Value of the Control Variable. This decides the number of times the loop will execute.
2. When the Control Variable exceeds the Final Value the loop comes to an end.
2. How is While… Wend loop different from Do…Until loop?
Ans :-WHILE…WEND- If the Condition is false at the beginning of the execution of the loop, the While…Wend does not execute at all.
DO UNTIL…LOOP-This loop executes repeatedly till the given condition remains false.
3. Explain the difference in working of For Next and Do…Until
Ans :- For…Next- This loop executes the fi nal number of time, from the initial value to the final value.
Do…Until-This loop executes repeatedly till the given condition remains false
Learn the basics and a bit beyond to improve your backend dev skills.
Designer
Learn the basics and a bit beyond to improve your backend dev skills.
Designer