Challenge: Outputting a Triangle
Modify the code to print a triangle like the following:
9123******
main.cs
99
1
2
3
4
5
6
7
8
9
10
namespace ConsoleApp
{
internal class Program
{
static void Main(string[] args)
{
System.Console.WriteLine("***");
}
}
}
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
99
1
2
3
4
5
6
7
8
9
10
11
12
namespace ConsoleApp
{
internal class Program
{
static void Main(string[] args)
{
System.Console.WriteLine("***");
System.Console.WriteLine("**");
System.Console.WriteLine("*");
}
}
}
123456789101112namespace ConsoleApp { internal class Program { static void Main(string[] args) { System.Console.WriteLine("***"); System.Console.WriteLine("**"); System.Console.WriteLine("*"); } } }
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 4
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår