Printing triangles - c# program, DOT NET Programming

Printing Triangles - C# Program

I need program code for Printing Triangles in C#. Can anybody send me there ideas?

Posted Date: 2/12/2013 12:27:39 AM | Location : United States





Yes, i have an example regarding your problem you specified above. Try this it is beneficial for you.

 using System;  

class DollarDesign

{

  public static void Main()

 {

   int no=1,i,j;  

for(i = 1 ; i < 6 ; i ++) // Outer loop for incrememting the numbers to be displayed

  {

Console.WriteLine(" "); // Leave a line after each new number

for(j = 1; j < 6; j ++) // Inner loop to specify the numer of times the

particular number is to be printed.

   {

    Console.Write(no);

     if(i == j) 

      // If a number is printed that many number of times.

      // e.g. If 3 is there. The if 3 is printed 3 times, then this condition arises

    {

     no = no + 1; // Increment the number

      goto loop1; // Goto outer loop

    }

   }

  loop1:continue;

  }

  Console.ReadLine();

 }

}

Posted by samuel | Posted Date: 2/12/2013 12:28:19 AM

Thank you, for your expert advice. You have described very useful code. 

Posted by Amy | Posted Date: 2/12/2013 12:29:11 AM


Related Discussions:- Printing triangles - c# program, Assignment Help, Ask Question on Printing triangles - c# program, Get Answer, Expert's Help, Printing triangles - c# program Discussions

Write discussion on Printing triangles - c# program
Your posts are moderated
Related Questions
finding greatest of n no''s in c#

We would like you to develop the subsequent requirements in one plug-in already in production. The plug-in was developed in Visual Studio 2010 .NET Framework 4 C# and synchronizes

Project Description: This is an online customization printing system they use for multiple organizations to allow customizing  and access of materials they allocate to drive iss

I need CELL PHONE PINGING for fugitive tracking Project Description: I want an application like the following: it provides cell phone pinging(location information via gps) wi

Project Description: The website should be CMS based; coding done only on ASP, MySql databases, .net script, aspx and java use with least of the flash work. We will be sharing j

First let me start by saying that I have been writing code for almost 25 years. So I am only looking for someone to assist advance a project I am working on. Someone that is unders

How inheritance is achieved in VB.NET? The Inheritance is achieved by using "Inherits" keyword in the VB.NET (& For C# it is ":"). Easy Sample is provided in CD for understandi

what are major difference between classic ADO &ADO.NET?

Can we get a strongly typed resource class? You can now get strongly types classes in the VS.NET intellisense as shown in the figure below. Figure: - Strongly typed re

C# Programming 1. What is .Net Framework? 2. Write short notes on constructors and destructors. 3. Explain boxing and unboxing with examples. 4. What is a mixed mode a