Ahmet Taha

Ahmet Taha

  • NA
  • 381
  • 18.1k

descending for loop in c# console

Oct 29 2021 2:46 AM

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)