Given that : int kc = 15 , kd = 2 ; kd = kd * kc ; kc = kc + kd ; System.out.print ( " KC = " + kc + " KD = " + kd ); What will be the output?
Answers
Answered by
1
Answer:
Output : KC = 45 KD = 30
Explanation:
public class Main
{
public static void main(String[] args) {
int kc = 15 , kd = 2 ;
kd = kd * kc ;
kc = kc + kd ;
System.out.printf(" KC = %d KD = %d " , kc , kd);
}
}
kd = 2 * 15 = 30 // Now, kd = 30 && kc = 15
kc = 15 + 30 = 45 // Now, kd = 30 && kc = 45
Similar questions