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 Common Type System (CTS)? CTS is the component of CLR by which .NET Framework provides support for multiple languages because it have a type system that is common acros

What is the use of the Connection object? The Connection object is used to connect your application to a specific data source by giving the needed authentication information in

Project Description: We want to design and develop a new Sportbook Platform from scratch, subsequent functionality: - Have a full functionality like other similar websites (S

Our company is seeking a talented PHP Developer to join our young and dynamic online media agency. Must have: - Knowledge in SQL and Databases, proven indexing and coding exp

I have the working code I''m using to print the SQL table right now. I just need code to print in reverse order.

Calculating the Sum of Digits - C# Program Hi, Can any of you, tell me how can i calculate the sum of digits of a given number?

What is the difference among synchronous postback and asynchronous postback? The difference between synchronous and asynchronous postback is as follows: Asynchronous postbac

What are the different locks in SQL SERVER? Depending on the transaction level there are six types of lock that can be acquired on data :- 1)Intent: The intent lock des

Give a brief introduction of Windows Azure operating system. The Windows Azure operating system is used for running cloud services on the Windows Azure platform, as it includes