Demonstrating use of break, continue & goto - c# program, DOT NET Programming

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 anyone helps me?

Posted Date: 2/12/2013 12:22:55 AM | Location : United States





Well, I think that should not be so much difficult. You can use this code.

using System;  

class BreakContiuneGoto

{

  public static void Main()

 {

   int n = 10;

   while(n<200)

  {

    if(n<100)

   {

     if(n<50)

    {

      goto lessthan50;

    }

    Console.Write(" " +n);

    n = n + 20;

continue;

}  

lessthan50:

{

Console.Write(" " +n);

n = n + 10;

continue;

}  

if(n==50)

{

Console.WriteLine("");

n = n + 10;

continue;

}  

if(n > 90)

break;

Console.Write(" " +n);

n = n + 10;

}

Console.WriteLine();

Console.ReadLine();

}

}

Posted by diana | Posted Date: 2/12/2013 12:24:28 AM

Output:
10 20 30 40 50 60 70 80 90 110 120 130 140 150 160 170 180 190.

Posted by Jack | Posted Date: 2/12/2013 12:25:10 AM


Related Discussions:- Demonstrating use of break, continue & goto - c# program, Assignment Help, Ask Question on Demonstrating use of break, continue & goto - c# program, Get Answer, Expert's Help, Demonstrating use of break, continue & goto - c# program Discussions

Write discussion on Demonstrating use of break, continue & goto - c# program
Your posts are moderated
Related Questions
Problem: (a) (i) Using a diagram, illustrate the basic process in an ASP.NET Architecture involving at least five objects. (ii) List two methods and two collections

What is the difference between DELETE TABLE and TRUNCATE TABLE commands? Following are differences between delete & truncate commands:- 1)The DELETE TABLE syntax logs the de

I am concerned to doing like this project, i have 5 years of experience in .net skill in engineering and computer related positions with devotement section, I am now a Senior Softw

What are resource files? The Resource files are the files which contain program resources. Many programmers think that resource files are used only for storing strings. But you

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

Concept of Boxing and Unboxing The Boxing permits any value type to be implicitly converted to type object or to any other interface type implemented by the value type. The Box

Decision Making and Branching - C# Program Need Programming help on Decision Making and Branching in C#.

How do we configure "WebGarden"? The process model configured the "Web garden" settings in the "machine.config" or in the "Web.config" file. The configuration section is named

Need to develop a simple .net software I am seeking someone who can design a customized software for me, prefrebly in .NET. I have a sql server backend which i would like to use

What are benefits & Limitation of  Hidden fields? The benefits of using Hidden fields are as shown below :- 1)    They are very simple to implement. 2)    As the data is