Multiple Choice
What will be the result of running the following code fragment?
Int year = 0;
Double rate = 5;
Double principal = 10000;
Double interest = 0;
While (year < 10)
{
Interest = (principal * year * rate) / 100;
System.out.println("Interest " + interest) ;
}
A) The code fragment will display the interest calculated for nine years.
B) The code fragment will continue to display the calculated interest forever because the loop will never end.
C) The code fragment will not display the calculated interest and halt abruptly.
D) The code fragment will not display any output because it will not compile.
Correct Answer:

Verified
Correct Answer:
Verified
Q7: Which of the following conditions can be
Q8: Is the following code snippet legal? boolean
Q9: What will be the output of the
Q10: Choose the loop that is equivalent to
Q11: What is the output of the following
Q13: What is the output of the code
Q14: How many times does the following loop
Q15: What is the output of the following
Q16: What is the output of the code
Q17: What will be printed by the statements