Click here to Skip to main content
15,887,350 members
Please Sign up or sign in to vote.
1.00/5 (5 votes)
See more:
VB
hi ,i have to write a program in c# which will display the output as
12345
 1234
  123
   12
    1

i have written code for
VB
54321
  5432
   543
    54
     5


as
C#
for (int i = 1; i <= 5; i++)
            {
                for (int j = 5; j >= i; j--)
                { Console.Write(j);
                }
                Console.WriteLine();
               for (int k = i; k > 0; k--)
               { Console.Write(" ");
                }
            }
Posted
Updated 2-Nov-22 4:02am
v2
Comments
Richard MacCutchan 27-Nov-10 16:12pm    
This must be the program for five year olds judging by the number of times it gets posted here. If you really do not have the skills to perform such a simple task then I suggest you consider a different direction for your career path.
MCY 5-Dec-10 12:01pm    
you're kidding, right?

Sooooo, reverse it... We don't do people's homework for them - not because w'e're tooc good to help, but because we think it's important that you actually learn something.

Part of learning to be a programmer is learning how to analyze the problem and come up with a solution.
 
Share this answer
 
Console.WriteLine("12345");
Console.WriteLine(" 1234");
Console.WriteLine("  123");
Console.WriteLine("   12");
Console.WriteLine("    1");
 
Share this answer
 
Comments
fjdiewornncalwe 28-Nov-10 2:06am    
Nice Walt...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900