If x = 2 then after executing the statement ā€œ x = x + x + +ā€ the value of x will be | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
- 2

If x = 2 then after executing the statement ā€œ x = x + x + +ā€ the value of x will be

23rd Apr 2020, 4:16 AM
Salman Hanif Safi
Salman Hanif Safi - avatar
1 Resposta
+ 2
It will result in 4 it is better if you use (x++). Because initially x=2 and after that x= 2+2 because you used post increment value so first 2 will be added and then x will be increased by 1.
23rd Apr 2020, 4:26 AM
Ayush Kumar
Ayush Kumar - avatar