Gr 9 Chapter 8 notes - Computer Application
1. A set of instructions that are repeatedly executed till the condition is satisfied is known
as loop.
2. The three types of looping constructs are for loop, while loop and do while loop.
3. Syntax of for loop:
for(initialization ; condition ;updation)
{//body }
4. Syntax of while loop:
initialization;
while (condition)
{//body
//updation }
5. Syntax of do-while loop:
initialization;
do
{//body
//updation }
while (condition);
6. Loops are broadly classified into entry controlled loop and exit controlled loop.
7. In an entry controlled loop or entry restricted loop testing of the condition is
done at the entry point of the loop.
8. In an exit controlled loop or exit restricted loop testing of the condition is done
at the exit point of the loop after executing it once.
9. The execution of a block of statements for a fixed number of times is known as fixed
iterative loop.
10. Fixed iterative loop is also known as known iterative loop.
11. For loop is an example of fixed iterative loop.
12. The output on the new line statement is System.out.println.
13. The output on the same line statement is System.out.print.
14. The for loop has 3 parameters - initial value, test condition and update value.
15. The execution of a block of statements for an uncertain number of times is known as
an unfixed iterative loop.
16. Unfixed iterative loop is also known as unknown iterative loop.
17. The while and do- while loop are examples of exit controlled loops.
18. The jump statements help to transfer the control to another part of the program.
19. Three types of jump statements are break, continue and return.
20.The break statement is used to terminate a case or loop.
21. The continue statement will return the control back to the next iteration of the loop
leaving the rest of the statements unexecuted.
22. Finite loop - when the loop block is executed for a fixed number of iterations.
23. Finite loop is categorized into two types - continuous loop and step loop.
24. Continuous loop - the control variable is increased or decreased by one after each
iteration.
25. Step loop - the control variable is increased or decreased by a given value after each
iteration.
26. Infinite loop or endless loop - when the loop block is executed for endless
iterations.
27. Infinite loop using for loop
for( ; ;)
{//body }
28.Infinite loop using while
while(true)
{//body }
29. Infinite loop using do- while
do
{//body
}
while(true);
30.Null loop or Delay loop - A loop that does not include any statement to be repeated.
It is used to create a delay or pause in the execution .