0
How is 24 the output?
Java challenge https://code.sololearn.com/cy1KLk1xI6w4/?ref=app
2 Réponses
+ 1
Because here first if condition is satisfied that's why it printing result of a *b
int a=4;
int b=8;
if((b-a--)>=a)
{
System.out.println(a*b);
}
Here condition will check like this
if(8-4-- >=a) here u used post decrement thats why expression will be calculate after that a-- here value will be decrease by 1 if(8-4>=3) and bow the current value of a is 3 so output will be 3*8 which is 24
0
A.S. thank you