User Tools

Site Tools


cpp:control_structures:while

Differences

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

Link to this comparison view

cpp:control_structures:while [2012/10/12 02:12] (current)
Line 1: Line 1:
 +{{keywords>wiki library source code example reference}}
 +===== while =====
 +<code cpp>    
 +    #include <iostream> /* including standard library */
  
 +    while ( condition == true ) {
 +    do something until condition untrue
 +    }
 +</code>
 +
 +===== cpp Sourcecode Example =====
 +<code cpp>
 +
 +#include <iostream> /* including standard library */
 +
 +using namespace std;
 +int main(void) {
 +    int i=0;
 +    
 +    while (i <= 99) {
 +        cout << i << endl;
 +        i++;
 +    }
 +    return 0;
 +}
 +</code>
 +
 +    //output://
 +    
 +    0
 +    1
 +    2
 +    3
 +    4
 +    5
 +    6
 +    7
 +    ...
 +    up to 99
 +
 +    
advertising
cpp/control_structures/while.txt · Last modified: 2012/10/12 02:12 (external edit)

Impressum Datenschutz