Rahul Rajpoot

Rahul Rajpoot

  • NA
  • 264
  • 1.5k

i need an answer for my problem

Mar 26 2019 11:26 PM
 
*
+*
+*+
*+*+
*+*+*
 
 
 
 
class Program
{
static void Main(string[] args)
{
int n = Convert.ToInt32(Console.ReadLine());
for(int i = 0; i <= n; i++)
{
for (int j = 0; j <= i; j++)
{
if (j==i||i+j==n)
{
Console.Write("*");
}
else { Console.Write("+"); }
}
Console.WriteLine();
}
Console.ReadKey();
}

Answers (2)