Challenge: Outputting a Triangle
Modify the code to print a triangle like the following:
***
**
*
main.cs
12345678910namespace ConsoleApp { internal class Program { static void Main(string[] args) { System.Console.WriteLine("***"); } } }
- Use three
System.Console.WriteLinestatements. One of them is already in the code.
main.cs
123456789101112namespace ConsoleApp { internal class Program { static void Main(string[] args) { System.Console.WriteLine("***"); System.Console.WriteLine("**"); System.Console.WriteLine("*"); } } }
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 4
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Can you show me the code that needs to be modified?
What should I do if I want to print a larger triangle?
Can you explain how the WriteLine statements work in this context?
Awesome!
Completion rate improved to 1.59
Challenge: Outputting a Triangle
Swipe to show menu
Modify the code to print a triangle like the following:
***
**
*
main.cs
12345678910namespace ConsoleApp { internal class Program { static void Main(string[] args) { System.Console.WriteLine("***"); } } }
- Use three
System.Console.WriteLinestatements. One of them is already in the code.
main.cs
123456789101112namespace ConsoleApp { internal class Program { static void Main(string[] args) { System.Console.WriteLine("***"); System.Console.WriteLine("**"); System.Console.WriteLine("*"); } } }
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 4