+ 1
I want to ask that in c++ compiler why cout<<2*3+9 ; & cout<<2*3+9-1/2 ; giving me the same output "15" ??
C++ Question
2 Réponses
+ 7
Hi Sandeep, I think this probably be how the expression was evaluated:
2*3+9-1/2 ;
(2*3)+9-(1/2) // <- integer division 1/2 yields zero
(2*3)+9-(0)
Output: 15
Hth, cmiiw
+ 2
Oh yes .. got It . Thanks for helping me though 🙃