What is the output of the following code fragment?
Int i = 1;
Int sum = 0;
While (i <= 11)
{
Sum = sum + i;
I++;
}
System.out.println("The value of sum is " + sum) ;
A) The value of sum is 65
B) The value of sum is 66
C) The value of sum is 55
D) The value of sum is 56
Correct Answer:
Verified
Q11: What is the output of the code
Q12: What is the output of the code
Q13: What are the values of i and
Q14: Which error type does the "off-by-one" error
Q15: What is the output of the code
Q17: What is the output of the following
Q18: How many times will the following loop
Q19: What is the output of the following
Q20: What is the output of the code
Q21: What is the output of the code
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents