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)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now