Articles : C# Program to Print Triangle in Square
full Link : C# Program to Print Triangle in Square
Article Csharp, Article programs,
C# Program to Print Triangle in Square
C# Program to Print Triangle in Square
Program Statement:
Program Statement:
Write a program which display the following output on the screen.
####$####
###$#$###
##$###$##
#$#####$#
$#######$
Solution:
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");
}
}
}
enough already information about C# Program to Print Triangle in Square
hopefully the information C# Program to Print Triangle in Square can give you answers to all your questions ayang is conveyed to google.
finished already information about C# Program to Print Triangle in Square if you mers this information useful for you and want to bookmark or share please use link https://19miracles.blogspot.com/2013/12/c-program-to-print-triangle-in-square.html?m=1
Tag : Csharp, programs,


0 komentar:
Posting Komentar