Thursday, 28 November 2013

C# IMPLEMENTATION OF GOTO AND LABEL -----------|||||||||||||||||||||\\\\\\\\

CODE;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GotoNLabelProgram
{
    public class Program
    {
        public static void Main(string[] args)
        {
            for (int i = 1; i < 100; i++)
            {
                Console.WriteLine(" ");
                if (i>= 10)
                    break;
                for (int j = 1; j < 100; j++)
                {
              //      Console.WriteLine(" ");
                //    if (j == i)
                 //   {
                        Console.Write(" * ");
                        if (j == i)
                            goto loop1;

                    }
                loop1: continue;
                }
                Console.WriteLine("Termination by Break");
                Console.ReadKey();
              
            }
      
        }
    }

OUTPUT:


No comments:

Post a Comment