What is the output of the code below? for (int val = 0; val < 4; val ++)
{
Int sum = val;
For (int num = 0; num < val; num++)
{
Sum = sum + num;
}
System.out.print (sum + " ") ;
}
A) 0 1 3 6
B) 0 1 4 10
C) 0 2 5 9
D) 0 2 7 16
Correct Answer:
Verified
Q45: Which of the following loops executes the
Q70: What is the output of the code
Q71: How many times does the following loop
Q72: Assume the following variable has been declared
Q73: What for loop can be used in
Q74: How many times does the following loop
Q76: Which loop does not check a condition
Q77: What is the output of the code
Q78: What is the output of the code
Q79: What is the result when the following
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