If you want to make a triangle shape using C# then just do it...........
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class testing
{
static void Main(string[] args)
{
for (int i = 0; i < 10; i++)
{
for (int j = i; j < 10; j++)
{
Console.Write(" ");
}
for (int k =i+1; k> 0; k--)
{
Console.Write("*");
}
Console.WriteLine("");
}
Console.ReadKey();
}
}
}
Output of the Program will be like this.....
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class testing
{
static void Main(string[] args)
{
for (int i = 0; i < 10; i++)
{
for (int j = i; j < 10; j++)
{
Console.Write(" ");
}
for (int k =i+1; k> 0; k--)
{
Console.Write("*");
}
Console.WriteLine("");
}
Console.ReadKey();
}
}
}
Output of the Program will be like this.....
No comments:
Post a Comment