CSharp - What is the output: float type literal?

Question

What is the output of the following code?

using System;
class MainClass
{
   public static void Main(string[] args)
   {
       float f = 4.5;
       Console.WriteLine(f);

   }
}


Click to view the answer

float f = 4.5;//compile time error

Note

Without the F suffix, the following line would not compile, because 4.5 would be inferred to be of type double, which has no implicit conversion to float:

float f = 4.5F;