all about smartphone technologies we discuss here, ranging from specifications and prices, how to fix hp and we provide a lot of applications and games

C# Program to Print Triangle in Square

C# Program to Print Triangle in Square - welcome to our blog that presents a very complete information is Tech Phone ok now we will discuss the information you are seeking, may I guess if you are looking for information on C# Program to Print Triangle in Square if properly come please continue reading until the end, we also provide other information, do not forget to get around:

informations : C# Program to Print Triangle in Square
Full link : 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");
}
}
}




Articles C# Program to Print Triangle in Square already been discussed

A few information about the C# Program to Print Triangle in Square , hopefully can provide benefits to all of you.

You're reading an article C# Program to Print Triangle in Square and this article has a link to https://mastispotgroup.blogspot.com/2013/12/c-program-to-print-triangle-in-square.html to revel book mark. Hopefully this article could be useful, do not forget to look for information on obtaining the phone tech blog.

Tag : , ,
Share on Facebook
Share on Twitter
Share on Google+
Tags :

Related : C# Program to Print Triangle in Square

0 komentar:

Posting Komentar