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 [2024/02/16 01:04] (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
 +
 +    

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
cpp/control_structures/while.txt · Last modified: 2024/02/16 01:04 (external edit)

Impressum Datenschutz