Monday 28 January 2013


// Write the programs to print the even numbers between 1 to 100. 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace evennum
{
    class Program
    {
        static void Main(string[] args)
        {
            int n ;
            {
                Console.WriteLine("the even numbers between 1 to 100 are :");
                for (n = 1; n <= 100; n++)
                    if(n%2==0)
                    //while (n <= 100)
              
                Console.WriteLine(n);
                Console.ReadKey();
             }
        }
    }
}

No comments:

Post a Comment