User Tools

Site Tools


cplusplus:repetition_examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
cplusplus:repetition_examples [2019/02/12 02:17] – [increment operator] mithatcplusplus:repetition_examples [2019/02/12 02:19] mithat
Line 1: Line 1:
 ====== Control Structures: Repetition examples ====== ====== Control Structures: Repetition examples ======
  
-===== while =====+===== The while statement =====
  
 <file c++ simple_while.cpp>// This program counts to an upper limit <file c++ simple_while.cpp>// This program counts to an upper limit
Line 40: Line 40:
 </file> </file>
  
-===== Counter-controlled repetition =====+ 
 +===== Repetition code patterns ===== 
 + 
 +==== Counter-controlled repetition ====
 <file c++ counter-controlled-repetition.cpp>// This program counts to an upper limit <file c++ counter-controlled-repetition.cpp>// This program counts to an upper limit
 #include <iostream> #include <iostream>
Line 58: Line 61:
     return 0;     return 0;
 }</file> }</file>
-===== Sentinel-controlled repetition =====+ 
 +==== Sentinel-controlled repetition ====
  
 <file c++ simple-sentinel.cpp>    // This program determines whether test scores are passing marks. <file c++ simple-sentinel.cpp>    // This program determines whether test scores are passing marks.
Line 94: Line 98:
 </file> </file>
  
-===== Input validation =====+==== Input validation ====
 <file c++ simple-input-validation.cpp>// Simple example of input validation. <file c++ simple-input-validation.cpp>// Simple example of input validation.
 #include <iostream> #include <iostream>
Line 124: Line 128:
 </file> </file>
  
-===== Running total =====+==== Running total ====
 <file c++ simple-running-total.cpp>// Simple running total example. <file c++ simple-running-total.cpp>// Simple running total example.
 // Total all the integers between a lower and an upper bound. // Total all the integers between a lower and an upper bound.
Line 152: Line 156:
  
 </file> </file>
-===== for =====+ 
 +===== The for statement =====
 <file c++ simple-for.cpp>// This program counts to an upper limit using a for structure. <file c++ simple-for.cpp>// This program counts to an upper limit using a for structure.
 #include <iostream> #include <iostream>
cplusplus/repetition_examples.txt · Last modified: 2019/02/14 21:28 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki