From e1c2c1994d8823259b0da7bbd31351f7f7b4972b Mon Sep 17 00:00:00 2001 From: Sebastian Brosch Date: Sat, 12 Oct 2024 18:33:31 +0200 Subject: [PATCH] added solution --- VL03-01-01/main.cc | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 VL03-01-01/main.cc diff --git a/VL03-01-01/main.cc b/VL03-01-01/main.cc new file mode 100644 index 0000000..1d4495d --- /dev/null +++ b/VL03-01-01/main.cc @@ -0,0 +1,31 @@ +#include + +int main() { + + // count down from 10 (C) + for (int i = 10; i >= 0; i--) { + printf("%d\n", i); + } + + // count down from 10 (C++) + for (int i = 10; i >= 0; i--) { + std::cout << i << std::endl; + } + + // all capital letters from A to Z (C). + for (int i = 65; i <= 90; i++) { + printf("%c\n", i); + } + + // all capital letters from A to Z (C++). + for (int i = 65; i <= 90; i++) { + std::cout << char(i) << std::endl; + } + + // all capital letters from A to Z (C++). + for (char c{'A'}; c <= 'Z'; c++) { + std::cout << c << std::endl; + } + + return 0; +} \ No newline at end of file