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
What is Object Relational Designer? The 0/R Designer provides a visual design surface to make LINQ to SQL entity classes and associations (relationships) that are based on obje

How can we get the state of the requested process? XMLHttpRequest get the current state of the request operation by using the readyState property. This property checks the cond

Project Description: Legacy ASP.NET application for managing tasks for a private client needs a complete re-write. The application has approximately 2500 lines of code, combi

What is the difference between the Select clause and SelectMany() method in LINQ? Both the Select clause and SelectMany() method are used to produce a result value from a sourc

Need Experienced dot Net and PHP Programmers Project Description: Need Experienced dot Net., JSP, PHP, Java Programmers Skilled professional and command in Programming eit

Question: (a) List and describe the four parameters contained in the second section of the AdRotator Scheduler File. (b) Distinguish between the following types of "Locks"

Project Description: I am preparing a speech recognition program and need a quick code to get it done I am seeking for someone to create a Gmail API that can get subject, and co

how socket workes in .net

I need Online Real Commission Management system Project Description: Real Estate -- Store and retrieve Purchase plot customers, Employee to refer the customers get commiss

Project Description: customise samba pos. Just remove samba pos logo and rebrand it. The title in the frame needs to be changed as well as the splash screen at the beginning.