Learn how to Loop Useful in Programme?

Page 1

Learn how to Loop Useful in Programme? Loops are used to repeat a block of code. Being able to have your program repeatedly execute a block of code is one of the most basic but useful tasks in programming like C, C++ , Java, Python, .Net etc. There are 3 sections of Loop: 

Variable initialization.( e.g int x=0; )

condition( e.g while( x<=10) )

Variable increment or decrement ( x++ or x-- or x=x+2 )

Types of Loop: 1. Entry Control Loop: a. For Loop for ( variable initialization; condition; variable update ) { Code to execute while the condition is true }


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.