In this program, you’ll learn to multiply two floating point numbers in C# , store the result and display it on the screen.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
class Program { static void Main(string[] args) { float number1,number2,product; number1 = 12.45f; number2 = 10.74f; product = number1 * number2; Console.WriteLine("{0} * {1} = {2}",number1,number2, product); Console.ReadLine(); } } |
Output: