We are providing online training of realtime Live project on Asp.Net MVC with Angular and Web API. For more information click here. If you have any query then drop the messase in CONTACT FORM

Tuesday, June 16, 2015

Write a program product of two number without using of multiplication operator(*)

class Program
    {
        static void Main(string[] args)
        {
            int temp = 0;
            Console.WriteLine("Enter the first number");
            int n1 = int.Parse(Console.ReadLine());
            Console.WriteLine("Enter the second number");
            int n2 = int.Parse(Console.ReadLine());
            for (int i = 1; i <= n1; i++)
            {
                temp = temp + n2;
            }
            Console.WriteLine("product of two numbers: {0}", temp);
            Console.ReadLine();
        }

    }

Output:

No comments: