From e0ce183060942e8cac534b18d72f6d03a89c6863 Mon Sep 17 00:00:00 2001 From: Logen Kain Date: Sat, 13 May 2017 19:24:46 -0700 Subject: [PATCH] cpp:loops: Added while example --- cpp/loops/while.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 cpp/loops/while.cpp diff --git a/cpp/loops/while.cpp b/cpp/loops/while.cpp new file mode 100644 index 0000000..8b822b7 --- /dev/null +++ b/cpp/loops/while.cpp @@ -0,0 +1,13 @@ +#include + +int main(){ + int i = 50; + int total = 0; + + while (i < 101){ + total += i; + std::cout << i << " " << total << std::endl; + i++; + } + return 0; +}