C# Program to Print Triangle in Square

C# Program to Print Triangle in Square - welcome to our blog that presents the full content How Gadget, the discussion this time we're discussing that you find that C# Program to Print Triangle in Square , we have provided complete information with images that are easy to understand, the explanation is simple but complete, therefore please read until the end :)

This is about : C# Program to Print Triangle in Square
And this article : C# Program to Print Triangle in Square
Article Csharp, Article programs,

You can also see our article on:


C# Program to Print Triangle in Square

C# Program to Print Triangle in Square

Program Statement:
Write a program which display the following output on the screen.
####$####
###$#$###
##$###$##
#$#####$#
$#######$

Solution:
 class shape
{
int x, y;
public void sh()
{
Console.WriteLine();
for (x = 1; x <= 5; x++)
{
for (y = 1; y <= 5 - x; y++)
{
Console.Write("#");
}
Console.Write("$");
for (y = 2; y <= x * 2 - 1; y++)
{
Console.Write("#");
}
Console.Write("\b$");
for (y = 1; y <= 5 - x; y++)
{
Console.Write("#");
}
Console.WriteLine("\n");
}
}
}




Information C# Program to Print Triangle in Square has been completed we present

A few of our information about the C# Program to Print Triangle in Square , we hope you benefit from this article

You have just read the article C# Program to Print Triangle in Square and many articles about gadget in our blog this, please read it. and url link of this article is https://howtomonetizeeverything.blogspot.com/2013/12/c-program-to-print-triangle-in-square.html Hopefully discussion articles on provide more knowledge about the world of tech gadgets.

Tag : , ,

1 Response to "C# Program to Print Triangle in Square "