Learn
We learned how to output a line of text with the following code:
std::cout << "ππ¨\n";
It will output:
ππ¨
We can also output multiple lines by adding more std::cout
statements:
std::cout << "Hello\n"; std::cout << "Goodbye\n";
This will output:
Hello Goodbye
Now letβs use what we learned so far to complete a coding challenge!
Instructions
1.
Instead of displaying those two lines in the output, edit the code so that we output the following pattern in the terminal:
1 2 3 4 5 6 7 8 9 10
Exactly how it is.
Remember you can use the hint if you need help.
Take this course for free
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.