Thursday, 28 November 2013

C# BREAK N CONTINUE IMPLEMENTATION---------|||||||||||||||||||

CODE:

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

namespace ContinueAndBreakProgram
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = 10;
            while (n < 200)
            {
                if (n < 50)
                {
                    Console.WriteLine(" " + n);
                    n = n + 10;
                    continue;
                }
                if (n == 50)
                {
                    Console.WriteLine();
                    n = n + 10;
                    continue;
                }
                if (n > 90) break;
                   
                Console.WriteLine(" " + n);
                n = n + 10;
            }
            Console.WriteLine();
            Console.ReadKey();
        }
    }
}

OUTPUT:


No comments:

Post a Comment