Multiplication of three numbers in C#



 Write a C# Sharp program to print the output of multiplication of three numbers which will be entered by the user


Test Data:
Input the first number to multiply: 2
Input the second number to multiply: 3
Input the third number to multiply: 6

Expected Output:
2 x 3 x 6 = 36

solution

            int a, b, c, total;

            Console.WriteLine("Input the first number to multiply");

            a =Convert.ToInt32( Console.ReadLine());

            Console.WriteLine("Input the second number to multiply");

            b = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Input the third number to multiply");

            c = Convert.ToInt32(Console.ReadLine());

            total = a * b * c;



            Console.WriteLine("total "+total);

            Console.ReadLine();

Comments

Popular posts from this blog

ANCHOR TAG.HTML

switch in c#