Saturday, 10 October 2015

write a program in do while loop to show multiplication table of a given number

using System;
class Program
{
    public static void Main()
    {
        Console.WriteLine("Enter a number whose table you want");
        int Number = Convert.ToInt32(Console.ReadLine());
        int i = 1;
        do
        {
            int table = Number * i;
            Console.WriteLine("{0} X {1} = {2}",Number,i,table);
             i++;
        } while (i <= 10) ;
    }
}

No comments:

Post a Comment