Monday, 20 February 2017

multiplication table program in c#

frequently asking logical program in interviews for dotnet fresher

//multiplication table program in c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            int n, i;
            Console.WriteLine("enter a number:");
            n = int.Parse(Console.ReadLine());
            for (i = 1; i <= 10; i++)
            {
                Console.WriteLine(n + " * " + i + " = " + n * i);
            }
            Console.ReadLine();
        }
    }
}


Output screenshot







No comments:

Post a Comment