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
Project Description: hi i need to develop a software scrapebox exect same with all Skills required: .NET, Java, C# Programming, Visual Basic, Visual Basic for Apps

What are queues and stacks? Stacks refer to a list in which all items are accessed and processed on the Last-In-First-Out (LIFO) basis. In a stack, elements are inserted (push

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

Converting $ into Rs.  - C# Program I am a learner of C# language and i am struggling with how to convert $ into Rs. in C#. Can you have any code examples for this?


Install Modules to enhance Site Proformance Project Description: As shown, I need the subsequent modules installed, to improve loading time for my graphics and images, improv

What is basic use of "DataView"? The "DataView" represents the whole table or can be small parts of rows depending on some criteria. It is the best used for sorting and finding

What is LOCK escalation? The Lock escalation is the process of converting of the low level locks (such as row locks, page locks) into the higher level locks (such as table lock

How can you use Hidden frames to cache client data? This technique is implemented by developing a Hidden frame in page which will have your data to be cached. T cols="100

Prepare datamodel, API and more Project Description: Dear all, we would like you to prepare database and an API which can be used in the shopping cart (checkout and delivery