+ 2
What is the value of a...
int a = 7, i,c; if (a<8) for(i=0;i<a;i++) i += i; a = i + ++i;
9 Respostas
+ 3
Again? 16
+ 3
@Ken Ah, my bad. You're right. He's tagged all languages. Thought it was a C++ specific
+ 2
Testing would clarify, but in the last line, I think the increment happens before the addition, making it 8 + 8
+ 1
Could someone explain why c++ gives 16?
+ 1
Aaaah clever quizz. Yes Ken is right, the unary increment takes priority over the sum, making it 16. With this compiler at least (this is why it could be different with other languages).
+ 1
Don't you dare, this question isn't suitable. The results differ depending on the programming language. The syntax doesn't seem to belong to any specific language, and he declared a variable that he never used (c).
+ 1
I think everybody here's pretty chill, I was the only one to get a little excited, just because some questions added to the quiz factory aren't suitable, so I wanted to prevent anyone from trying to add this one.
0
hhhhh....guys just chill...... i am new in programming, still i m learning... so sorry for the inconvenience....