3
Answers

descending for loop in c# console

Ahmet Taha

Ahmet Taha

3y
446
1

Hello Guyz,

i need your help , the output should be like this;

11111

2222

333

44

5

here is my code:

int x;
int y;
for (x = 1; x <= 5; x++)
{
    for (y = 1; y <= x; y++)
        Console.Write(x);
    Console.Write("\n");
}
Answers (3)