Star pattern in c#

 
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Text;  
  5. using System.Threading.Tasks;  
  6. namespace variables  
  7. {  
  8.     class demo   
  9.     {  
  10.         static void Main(string[] args)  
  11.         {  
  12.             Console.WriteLine("enter value of n");  
  13.             int n = Convert.ToInt32(Console.ReadLine());  
  14.             for (int i = n; i >= 1; i--)   
  15.               
  16.                 for (int j = 1; j <= i; j++)  
  17.                 {  
  18.                     Console.Write(j);  
  19.                 }  
  20.             }  
  21.             Console.ReadLine();  
  22.         }  
  23.     }  
  24. }  
 
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Text;  
  5. using System.Threading.Tasks;  
  6. namespace variables   
  7. {  
  8.     class demo   
  9.     {  
  10.         static void Main(string[] args)  
  11.         {  
  12.             Console.WriteLine("enter value of n");  
  13.             int n = Convert.ToInt32(Console.ReadLine());  
  14.             for (int i = n; i >= 1; i--)   
  15.             {  
  16.                 Console.WriteLine(" ");  
  17.                 for (int j = 1; j <= i; j++)  
  18.                 {  
  19.                     Console.Write(" ");  
  20.                 }  
  21.                 for (int q = i; q <= n; q++)   
  22.                 {  
  23.                     Console.Write(" * ");  
  24.                 }  
  25.             }  
  26.             Console.ReadLine();  
  27.         }  
  28.     }  
  29. }