C# Programm inverted right angle pyramid of star.

Saturday, 11 February 2012

Code:
using System;
class Test
{
     public static void Main()
     {
       int i,j;
       for(i=0;i<5;i++)
       {
           for(j=i;j<5;j++)
           {
               Console.Write('*');
           }
           Console.WriteLine("");
        }
     }
} 
OUTPUT:-

1 comments:

  1. Unknown said...:

    Hello I am wondering how would you do it with numbers instead of stars?


    54321
    5432
    543
    54
    5

Post a Comment