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
How does CAS works? There are two key methods of CAS security policy- code groups and permissions. A code group contains assemblies in it in a manner that each .NET assembly is

How do we assign page specific attributes? The Page attributes are specified by using the @Page directive.

Full Time Coder My colleague is seeking for someone to work on his website via team viewer. First I would need scale following skills- a) C# - b) AJAX - c) LINQ to S

Demonstrating use of break, continue & goto - C# Program How can i use break, continue & goto in my assignment, I am looking for a program in C#. It would be feel great if any

Question 1 Discuss the following with respect to .NET Technologies Web Applications Web Server Connections Question 2 Write a sample program using ASP.NET explain

Are you available to discuss about my project. I'd like you to show first and then accept the project provided if we both agree to continue with each other. Skills required:

Explain keywords with example. Keywords are those words that are reserved to be used for an exact task. These words cannot be used as identifiers. You cannot use a keyword to

What is CLR?  CLR(Common Language Runtime) is the major resource of .Net Framework. It is collection of services such as garbage collector, exception handler, jit compilers etc

Project Description: i want to prepare a pollution checking software.. i have a demo of it.. Exactly someone to be created ..some changes to be included.. sms gateway t

Experienced Microsoft .NET web developer I have a various projects for which I need a web developer for. The developer will be the sole product owner hence should be dependab