Tuesday, 28 April 2015

//This program demonstrates the 'continue' statement
namespace ProfTyagi
{
    class democontinue
    {
        static void Main(string[] args)
        {
            int y = 0;
            for (int x = 1; x < 12; x++)
            {
                Console.WriteLine("x = " + x);
                Console.WriteLine("y = " + y);
                if ((x % 7) == 0)
                    continue;
                y++;
            }
            Console.WriteLine("Have you noticed the effect of continue");
        }
    }
}



No comments:

Post a Comment