What will be the output of the following C# code?
static void Main(string[] args)
{
float f;
for (f = 0.1f; f <= 0.5; f += 1)
Console.WriteLine( ++f );
Console.ReadLine();
}
static void Main(string[] args)
{
float f;
for (f = 0.1f; f <= 0.5; f += 1)
Console.WriteLine( ++f );
Console.ReadLine();
}A. 1.1
B. 0.1
C. 0.1 0.2 0.3 0.4 0.5
D. None of the mentioned
Answer: Option A

Join The Discussion