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: My needs are simple; the application will: - Get the results of a Google search query (The title, URL, the description, time posted) - Apply definite

What is Extensible Markup Language (XML). XML is an easy and flexible mark-up language in the text format. Nowadays, it is widely used to exchange a large variety of data over

If client side validation is enabled in your Web page, does that mean server side code is not run Whenever the client side validation is enabled server emit's JavaScript code f

What are the different levels Of IIS isolation?  The IIS consist of 3 level of isolation as shown below:- LOW (IIS process):- In this type of isolation the main IIS proc

A Super-hero SharePoint developer with great design skills Project Description: US: Our start-up company prepares a very innovative and cool SharePoint related product with c

What is object-oriented programming (OOP)? OOP is a method to develop logical modules, such as classes that contain properties, methods, fields, and events. An object is formed

What is the difference between Shadowing and Overriding? The main basic difference between shadowing and overriding are as follows:- 1) The Overriding redefines only the imp

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

Project Description: Looking for a developer who will develop a web portal like zulutrade, some features will be taken from signaltrader The changes would be like: 1) Only

What is XSLT? The XSLT is a rule based language used to transform XML documents into other file formats. The XSLT are nothing but generic transformation rules which can be appl