I am a newbie in C++ in my first little project is making me a headache.
If I understand the pbolem correctly, I need to cout the sum of the interval [a,b] which should mean: 17 + 18 + 19 + 20 + 21..... + 52 = ? (correct me if I am wrong!) I tried with while, do-while and they both ended up being an endless loop so now I am trying with for loop which gets me to just increasing the value of a until it reaches 52.
#include <iostream> int main(int argc, char* argv[]) { const int a = 17; const int b = 52; int summe = 0; for(summe = a; summe <=b; summe++) std::cout << "Summe: " << summe << "\n"; return 0; }