(Solved): \( 6 . \) What is the output of the following code? int \( \operatorname{Num} 1=25, \operatorname{N ...
\( 6 . \) What is the output of the following code? int \( \operatorname{Num} 1=25, \operatorname{Num} 2=35 \), Sum \( =10 \); if \( (\operatorname{Num} 1<\operatorname{Num} 2) \) Sum \( = \) Sum \( + \) Num 1 else Sum \( = \) Sum \( + \) Num2; Num1 \( +=15 \); \( \operatorname{Num} 2+=5 ; \) if \( ( \) Num \( 1<\operatorname{Num} 2) \) Sum \( =\mathrm{Sum}+ \) Num1; else \( \mathrm{Sum}=\mathrm{Sum}+\mathrm{Num} 2 \) System. Out.println (Sum);
Answer: The following piece of code will be executed as follows: There are three variables are initialised of type int such that, Num1 = 25, Num2 = 35, Sum = 10 Now the very first condition is if-else block. In if else block , when if condtion return