[Solved]What's x? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 15

[Solved]What's x?

int x = 4; x = ++|+|++; What's the value of x now? (Probably a 2 digit number)

6th Feb 2017, 11:07 PM
Jafca
Jafca - avatar
10 Answers
+ 31
its the greatest excuse I have heard ))))))@Jafca
8th Feb 2017, 11:15 AM
Emma
Emma - avatar
+ 26
most probably there was int I = 4; because in that case it will give 2 digit number as the output :)
8th Feb 2017, 11:02 AM
Emma
Emma - avatar
+ 12
@Emma I figured I must have read it wrong, oops xD I was eating chocolate cake
8th Feb 2017, 11:08 AM
Jafca
Jafca - avatar
+ 8
@K.C. Leung I did try and that's why I'm asking here :) I saw it in a user-submitted C# challenge question
7th Feb 2017, 12:06 AM
Jafca
Jafca - avatar
+ 4
Why don't you try to compile it ? The c# compiler complaint: error CS1525 Invalid expression term '|'
6th Feb 2017, 11:34 PM
K.C. Leung
K.C. Leung - avatar
+ 3
x=10
17th Feb 2017, 4:27 PM
Aliyu Bello
Aliyu Bello - avatar
+ 2
10
5th Mar 2017, 10:53 AM
mysammycaty
mysammycaty - avatar
0
11
8th Feb 2017, 1:26 PM
Soaheel Hassan
Soaheel Hassan - avatar
- 1
i think value of x=5 please correct me if i was wrong.
14th Feb 2017, 8:00 PM
Sarthak Sharma
Sarthak Sharma - avatar
- 1
x=16
5th Mar 2017, 12:12 PM
Dernisto
Dernisto - avatar