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
Mention different types of data providers available in .NET Framework. .NET Framework Data Provider for SQL Server - Give access to Microsoft SQL Server 7.0 or later version. I

Define XPATH. XPATH is an XML query language to select specific section of an XML document. By using XPATH you can address or filter elements and text in a XML document. For il

Job Portal A one-stop explanation to all your needs. Consist of employee as well as employer login accounts. Employee capable to look for jobs. Employer capable to post jobs.

What is an IL? Intermediate Language is also called as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language). All .NET source code is compiled to IL. IL



What is black box testing & White box testing? The Black box testing is also termed as functional testing. It ignores how the internal functionality of a system works & depends

Can a .NET web application consume Java web service? Yes Offcourse.Actually Webservices are independent  to language. It depends on WSDL and SOAP. so any one can develope the W

I am seeking to get a logo design for a business. Skills required: .NET, HTML, Graphic Design, PHP, Website Design

Explain all parts of a deployment diagram. Package: - The package logically groups element of a UML model. Node: - The Node is as physical system which represents a