C# Simple Loop Program example to print characters

C# Simple Loop Program example to print characters - we say welcome to you who have been searching for information via search engines such as Google, in a blog Tech Gallery, now we will discuss information about the C# Simple Loop Program example to print characters, we have been looking for a lot of information from a trusted and collect it in this blog, so you get the information complete and easy to understand, please read through:

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();
}



Information about the C# Simple Loop Program example to print characters we have conveyed

A few of our information about the C# Simple Loop Program example to print characters, I hope you can exploit carefully

You have finished reading C# Simple Loop Program example to print characters and many articles about Tech Gallery in our blog this, please read it. and url link of this article is https://littlebitjohnny.blogspot.com/2013/12/c-simple-loop-program-example-to-print.html Hopefully discussion articles on provide more knowledge about the world of new tech 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