loops in c
DESCRIPTION
This slide give the introduction to the various loops available in C Programming. Which include while loop, do while loop and for loop.TRANSCRIPT
![Page 1: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/1.jpg)
WHILEDO..WHILEFOREXITING FROM A LOOP (BREAK,CONTINUE, GOTO)
Loops
![Page 2: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/2.jpg)
While
![Page 3: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/3.jpg)
While
![Page 4: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/4.jpg)
While
![Page 5: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/5.jpg)
While
![Page 6: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/6.jpg)
Do…While
![Page 7: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/7.jpg)
D0…While
![Page 8: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/8.jpg)
Do…While
![Page 9: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/9.jpg)
Do…While
![Page 10: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/10.jpg)
For Loop
![Page 11: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/11.jpg)
For Loop
![Page 12: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/12.jpg)
For Loop
![Page 13: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/13.jpg)
For Loop
![Page 14: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/14.jpg)
For Loop
![Page 15: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/15.jpg)
For Loop
![Page 16: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/16.jpg)
For Loop
![Page 17: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/17.jpg)
Break Statement
It is an jump instruction and can be used inside the switch and loop statements.
The execution of the break statements causes the control transfer to the statement immediately after the loop.
![Page 18: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/18.jpg)
Break Statement
![Page 19: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/19.jpg)
Break Statement
![Page 20: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/20.jpg)
Break Statement
![Page 21: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/21.jpg)
Break Statement
![Page 22: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/22.jpg)
Break Statement
![Page 23: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/23.jpg)
Break Statement
![Page 24: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/24.jpg)
Continue Statement
It is a jump statement.It is used only inside the loop.Its execution does not exit from the loop but
escape the loop for that iteration and transfer the control back to the loop for the new iteration.
![Page 25: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/25.jpg)
Continue Statement
![Page 26: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/26.jpg)
Continue Statement
![Page 27: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/27.jpg)
Continue Statement
![Page 28: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/28.jpg)
Continue Statement
![Page 29: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/29.jpg)
Continue Statement
![Page 30: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/30.jpg)
Goto Statement
It is used the alter the normal sequence of flow by transferring the control to some other part of the program unconditionally.
It is followed by the label statement which determine the instruction to be handled next after the execution of the goto statement.
![Page 31: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/31.jpg)
Goto Statement
![Page 32: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/32.jpg)
Goto Statement
![Page 33: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/33.jpg)
Goto Statement
![Page 34: Loops in C](https://reader036.vdocuments.net/reader036/viewer/2022081504/554a1a92b4c9055c598b53af/html5/thumbnails/34.jpg)
Goto Statement