Let's look at how to draw figures using nested loops with more complex logic, for which we need to think more before coding.
Watch this video to review what we learned in this chapter: https://youtu.be/tj4s3BOijO4.
Before starting, let's review what we learned in this chapter.
We became acquainted with the new string
constructor:
string printMe = new string('*', 5);
We learned to draw figures with nested for
loops:
for (var r = 1; r <= 5; r++)
{
Console.Write("*");
for (var c = 1; c < 5; c++)
Console.Write(" *");
Console.WriteLine();
}
We will work on the following set of practical problems: