C# Programming - Datatypes - Discussion

Discussion Forum : Datatypes - General Questions (Q.No. 8)
8.
What will be the output of the following code snippet when it is executed?
    int x = 1; 
    float y = 1.1f;
    short z = 1;
    Console.WriteLine((float) x + y * z - (x += (short) y));
0.1
1.0
1.1
11
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
18 comments Page 2 of 2.

Syed Fahd said:   8 years ago
Why (x+= (short) y) is becoming (x=+1)?

What does short mean?

Athini said:   8 years ago
What is the value of float and short and what is the sign +=?
(1)

Pranali said:   1 decade ago
I am not understand how to convert (x+=1) become 2.

Apoorv said:   1 decade ago
I am not able to understand how (x+=1) become 2.

Gaytri Verma said:   1 decade ago
Its very difficult but help to build the logic.

Mulu gebrehiwet said:   9 years ago
This question is very very important.
(3)

Monalisa Arya said:   1 decade ago
Please tell me how it is solved?

Madhuri said:   1 decade ago
Thank you teju.


Post your comments here:

Your comments will be displayed after verification.