Print pyramids of numbers - c# program, DOT NET Programming

Print Pyramids of Numbers - C# Program

Hello can you please provide me some examples regarding to the Print Pyramids of Numbers in C#.

Posted Date: 2/12/2013 12:44:11 AM | Location : United States





In this code i will try to slow your problem.  Hope it will help you.

Program:

using System;

class PyramidNumbers

{

public static void Main()

{

int i,j,num=5,k;

for(i=1;i<=num;i++)

{

for(k=num;k>=i;k--)// Loop for the blank spaces

{

Console.Write(" ");

}  

for(j=1;j<=i;j++)// Loop for determining the number of times the number is to be written

{

Console.Write(" " +i); // " " is a space needed in between the numbers

}     

Console.Write("\n"); // Go to the next line for next number

}  

Console.ReadLine();    

}

}

Posted by Harry | Posted Date: 2/12/2013 12:46:00 AM

Thank you so much. Everything is ok and cleared.

Posted by Amy | Posted Date: 2/12/2013 12:47:03 AM


Related Discussions:- Print pyramids of numbers - c# program, Assignment Help, Ask Question on Print pyramids of numbers - c# program, Get Answer, Expert's Help, Print pyramids of numbers - c# program Discussions

Write discussion on Print pyramids of numbers - c# program
Your posts are moderated
Related Questions
What is XML Text Reader? The "XmlTextReader" class helps to give fast access to streams of XML data in a forward-only and read-only manner. The XMLTextReader also checks if the

Question 1 Discuss the following with respect to .NET Technologies Web Applications Web Server Connections Question 2 Write a sample program using ASP.NET explain

What is project management? Applying the knowledge, skills, techniques, tools in project and deliver project deliverable is a short definition of the project management. It's b

Project Description: Digital invy - inventory management Main Features User friendly windows based software Multi Branch Multi company facility Multi user Integra

What are the ways of parsing XML document? The XML parser sits in between the XML document and the application who want to use the XML document. The Parser exposes a set of wel

Program of Nested Loop - C# Program I am a learner of C# language and i am struggling with the Loops in c#. Can you have any code examples for this.

Assembly: 1) Assembly is a unit of deployment such as EXE or a DLL. 2) An assembly consists one or more files (dlls, exe's, html files etc.),& represents a group of resources,

What is ReaderWriter Locks? You may want to lock the resource only whenever data is being written and permit multiple clients to parallel read data when data is not being updat

Demonstrating use of break, continue & goto - C# Program How can i use break, continue & goto in my assignment, I am looking for a program in C#. It would be feel great if any

What are major events in GLOBAL.ASAX file? The Global.asax file, which is derived from the HttpApplication class, maintains a pool of the HttpApplication objects, & assigns the