Wednesday, December 4, 2013

C# Simple Loop Program example to print characters

C# Simple Loop Program example to print characters - welcome to the blog Gadget Warrior, on this occasion we will discuss the information titled C# Simple Loop Program example to print characters as you are looking for, we have collect a lot of data to make this article so that you are satisfied with the information we convey, well please continue reading:

This is about : C# Simple Loop Program example to print characters
And this article : C# Simple Loop Program example to print characters
Article Csharp, Article programming, Article programs,

You can also see our article on:


Simple Loop Problem to Print A B D H P

Problem Statement:
Write a program using for loop which prints the following output. (You have to find a pattern to print alphabetics in this order)
A B D H P

Solution:

static void Main(string[] args)
{
int i,j,ch=0,n;
Console.Write("A ");
for (i = 1; i <= 4; i++)
{
n = 1;
for (j = 1; j <= i; j++)
{
n = n * 2;
ch = 64 + n;
}
Console.Write((char)ch + " ");
}

Console.ReadLine();
}



Articles C# Simple Loop Program example to print characters finished we discussed

A few of our information about the C# Simple Loop Program example to print characters, I hope that we submit article easy to understand

You've finished reading an article C# Simple Loop Program example to print characters and many articles about gadget in our blog this, please read it. and url link of this article is http://mallcopwarrior.blogspot.com/2013/12/c-simple-loop-program-example-to-print.html Hopefully discussion articles on could provide more knowledge about gadgets.

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

Related : C# Simple Loop Program example to print characters

0 comments:

Post a Comment