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.WriteLine statements. 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("*"); } } }
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 4
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
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 why we use three separate WriteLine statements?
Awesome!
Completion rate improved to 1.59
Challenge: Outputting a Triangle
Pyyhkäise näyttääksesi valikon
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.WriteLine statements. 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("*"); } } }
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 4