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
πŸ’¬ Discuss
βœ… Correct Answer: (D) 0.4000001

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
230
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ravi Chauhan
Publisher
πŸ“ˆ
85%
Success Rate