If you liked it don't forget to follow me-
Instagram-yadavgaurav251
Facebook-www.facebook.com/yadavgaurav251
Size: 1.56 MB
Language: en
Added: Nov 02, 2015
Slides: 19 pages
Slide Content
Iteration Statement Made by Gaurav Yadav XI-A Roll No- 10
What is Iteration? Iteration construct means repetition of set of statements depending upon a condition test. Till the time of condition is true. ( or false depending upon the loop). A set of statements are repeated again and again. As soon as the condition become false (or true), the repetition stops. The iteration condition is also called ”Looping Statement ” . Idli
ELEMNTS THAT CONTROL A LOOP Initialization Expression Test Expression Update Expression The Body Of The Loop
T ype of f or Loop while Loop Do while Loop
The for Loop
The for Loop In computer science a for-loop (or simply for loop ) is a programming language control statement for specifying iteration, which allows code to be executed repeatedly. Syntax for ( ForInit ; ForExpression ; PostExpression ) Action Example for ( int i = 0; i < 3; ++ i ) { cout << " i is " << i << endl ; }
Flow Chart For A for-Loop
Example Output Input
The while Loop
The while Loop In most computer programming languages, a while loop is a control flow statement that allows code to be executed repeatedly based on a given boolean condition. The while loop can be thought of as a repeating if statement . Syntax
Flow Chart Of A while Loop
Example Input Output
The do-while Loop
The do-while Loop a do while loop is a control flow statement that executes a block of code at least once, and then repeatedly executes the block, or not, depending on a given boolean condition at the end of the block . Syntax do Action while ( Expression )