C# Simple Loop Program example to print characters

C# Simple Loop Program example to print characters - welcome to our blog Techno Live, now we will discuss information about the C# Simple Loop Program example to print characters, our admins on this blog has been around to collect information you are looking for so that we usakan to display complete information for you, and in this blog, you can also search for other information, ok please continue reading may be easily understood:

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:


C# Simple Loop Program example to print characters

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 you can exploit carefully

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

Tag : , , ,

0 Response to "C# Simple Loop Program example to print characters"

Post a Comment