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