From cf0dd370256f57fb1bd3f6a6348dffbc29f87ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20G=C3=B6r?= Date: Sun, 30 Jun 2024 02:48:08 +0300 Subject: [PATCH] ChangeLog update and scope example explained --- ChangeLog | 2 ++ src/scope_example.cpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/scope_example.cpp diff --git a/ChangeLog b/ChangeLog index 2862360..eff9da4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2024-06-30 hwpplayer1 + * src/scope_example.cpp: scope example sum of 1 to 10 inclusive is explained + * src/if_statement.cpp: if statement explained/code written 2024-06-24 hwpplayer1 diff --git a/src/scope_example.cpp b/src/scope_example.cpp new file mode 100644 index 0000000..3682bad --- /dev/null +++ b/src/scope_example.cpp @@ -0,0 +1,14 @@ +#include + +int main() +{ + int sum = 0; + for (int val = 0; val <= 10; ++val) + + sum += val; + std::cout << "Sum of 1 to 10 inclusive is " + << sum << std::endl; + + + return 0; +} \ No newline at end of file