Examveda

What will be the output of the following C# code?
static void Main(string[] args)
{
    float s = 0.1f;
    while (s <= 0.5f)
    {
        ++s;
        Console.WriteLine(s);
    }
    Console.ReadLine();
}

A. 0.1

B. 1.1

C. 0.1 0.2 0.3 0.4 0.5

D. No output

Answer: Option B


Join The Discussion

Related Questions on Control Flow Statements in C Sharp