We will look into most important star pattern in C# console application, which is asked most of time in interview.
Introduction
This is a simple article where we will look into different star pattern in C# which are frequently asked in interview.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace variables
{
class demo
{
static void Main(string[] args)
{
Console.WriteLine("enter the number");
int x = Convert.ToInt32(Console.ReadLine());
for (int i = 1; i <= x; i++)
{
Console.WriteLine("");
for (int j = 1; j <= i; j++)
{
Console.Write(j);
}
}
Console.ReadLine();
}
}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace variables
{
class demo
{
static void Main(string[] args)
{
Console.WriteLine("enter the number");
int x = Convert.ToInt32(Console.ReadLine());
for (int i = 1; i <= x; i++)
{
Console.WriteLine("");
for (int j = 1; j <= i; j++)
{
Console.Write(i);
}
}
Console.ReadLine();
}
}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace variables
{
class demo
{
static void Main(string[] args)
{
Console.WriteLine("enter value of n");
int n = Convert.ToInt32(Console.ReadLine());
for (int i = n; i >= 1; i--)
{
Console.WriteLine(" ");
for (int j = 1; j <= i; j++)
{
Console.Write(j);
}
}
Console.ReadLine();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace variables
{
class demo
{
static void Main(string[] args)
{
Console.WriteLine("enter value of n");
int n = Convert.ToInt32(Console.ReadLine());
for (int i = n; i >= 1; i--)
{
Console.WriteLine(" ");
for (int j = 1; j <= i; j++)
{
Console.Write(" ");
}
for (int q = i; q <= n; q++)
{
Console.Write(" * ");
}
}
Console.ReadLine();
}
}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Practice
{
class Program
{
static void Main(string[] args)
{
for (int i = 6; i >= 1; i--)
{
int count = 8;
for (int x = 1; x <= i; x++)
{
Console.Write(count);
count--;
}
Console.WriteLine(" ");
}
Console.ReadLine();
}
}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Practice
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("enter the value of n");
int x = Convert.ToInt32(Console.ReadLine());
for (int i = x; i >= 1; i--)
{
Console.WriteLine("");
for (int j = i; j >= 1; j--)
{
Console.Write(" ");
}
for (int s = i; s <= x; s++)
{
Console.Write("* ");
}
}
for (int i = x; i >= 1; i--)
{
Console.WriteLine("");
for (int j = i; j <= x; j++)
{
Console.Write(" ");
}
for (int q = i; q >= 1; q--)
{
Console.Write("* ");
}
}
Console.ReadLine();
}
}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;
using System.Data;
using System.IO;
namespace stringoperation
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("enter value of n");
int x = Convert.ToInt32(Console.ReadLine());
for (int i = 1; i <= x; i++)
{
Console.WriteLine("");
for (int j = 1; j <= i; j++)
{
Console.Write(j);
}
for (int k = x - 1; k >= i; k--)
{
Console.Write(" ");
}
for (int l = i; l >= 1; l--)
{
Console.Write(l);
}
}
Console.ReadLine();
}
}
}
Conclusion
So these are some of important star pattern asked during interview,Freshers searching for jobs may check this because going for interview.