Now that we are familiar with loops, it is time to practice our newly acquired skills, and as you know, this is achieved by a lot of code writing. Let's solve some practical problems.
Watch this video to review what we learned in this chapter: https://youtu.be/4G_oSUcx9ko.
We can repeat a code block using a
We can read a sequence of
n numbers from the console this way:
Before starting with the exercises, we will create a Visual Studio solution with the idea to hold the code for each exercises problem in a separate C# project inside the solution.
Create a (Blank Solution) in Visual Studio:
Set it up to start the current project by default (not the first one in the solution). Do that by right clicking on Solution 'Loops' -> [Set StartUp Projects…] -> [Current selection].
Now it's time to start working on the problems: