R

Ravi Chauhan • 9.62K Points
Tutor III

Q. What will be the output of the following C# code?

Code:
static void Main(string[] args)
{
    int x = 1;
    float y = 2. 4f;
    short z = 1;
    Console. WriteLine((float) x + y * z - (x + = (short) y) );
    Console. ReadLine();
}
  • (A) 0.4000004
  • (B) 0.4000023
  • (C) 0.0400021
  • (D) 0.4000001
  • Correct Answer - Option(D)
  • Views: 123
  • Filed under category C#

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics