Iteration Statement in C++

GauravYadav65 2,055 views 19 slides Nov 02, 2015
Slide 1
Slide 1 of 19
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19

About This Presentation

C++ Iteration Statement.Enjoy

If you liked it don't forget to follow me-
Instagram-yadavgaurav251
Facebook-www.facebook.com/yadavgaurav251


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 )

Flow Chart

Example Input Output

Iteration Do’s