+ 1
Can anybody explain how 12 is coming?
import java.util.*; class solo{ public static void main(String[] args){ int v1=5; int v2=6; int v3=++v2*v1/v2+v2; System.out.println(v3); } }
2 Respostas
+ 1
kiRA thanks😊
0
++ has highest precedence so
v2 = 7
* and / have same precedence so first * will be evaluated then /
v3 = 7*5/7 +7
v3= 35/7 +7
v3 = 5+7 = 12