Skip to main content

C#: Program #23 (While Loop)

using System;

namespace While_Loop
{
    class Program
    {
        static void Main(string[] args)
        {
            int i=1;

            while (i < 10)
            {
                if (i%2==0)
                {
                    i++;
                   continue;
                }

                Console.WriteLine("Odd number found:{0}",i);

                i++;


            }
            Console.ReadKey();
        }
    }
}

Comments

Popular posts from this blog

C#: Program #15 (For Loop)

using System; namespace Loops {     class Program     {         static void Main(string[] args)         {                         object[] information = {"Gray", "14-Arid-4052", "Rawalpindi",21,3.80};             for (int i = 0; i < information.Length; i++)             {                 Console.WriteLine("The value of index {0} is {1}",i,information[i]);             }                 Console.ReadKey();         }     } }