cpp:loops: Added while example
This commit is contained in:
parent
724f05cbef
commit
e0ce183060
13
cpp/loops/while.cpp
Normal file
13
cpp/loops/while.cpp
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#include<iostream>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
int i = 50;
|
||||||
|
int total = 0;
|
||||||
|
|
||||||
|
while (i < 101){
|
||||||
|
total += i;
|
||||||
|
std::cout << i << " " << total << std::endl;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user