Q:

C# Program to Multiply two Floating Point Numbers

0

C# Program to Multiply two Floating Point Numbers

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

This program is compiled and tested on a Visual Studio 2012.

using System;

namespace TechStudyCSharp
{
    class Program
    {
        static void Main(string[] args)
        {          
            double num1;
            double num2;
            double total;

            Console.WriteLine("Enter first number :");
            num1 = Convert.ToDouble( Console.ReadLine());
            Console.WriteLine("Enter second number :");
            num2 = Convert.ToDouble(Console.ReadLine());

            total = num2 * num1;

            Console.WriteLine("\nTotal is : " + total);         
            Console.ReadKey();
        }
    }
}

Result:

Enter first number :

3.5

Enter second number :

4.5

Total is : 15.75

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C# Program to convert feet to meter.... >>
<< C# Program to Swap Values of Two Variables....