Associate
- Joined
- 8 Oct 2006
- Posts
- 1,236
Hi all,
Revising for my course and got a question that Im not sure about:
Given the following java program segment
_______for (int i=0;i < n-2;i++)
_________for (int j=i+1;j < n-1; j++)
__________for (int k=j+1; k < n; k++)
_____________System.out.println(i + “ “ + j + “ “ k);
Q.how many times is the print statement executed? Explain your answer.
Can anyone here help me understand this please?
Thanks
Revising for my course and got a question that Im not sure about:
Given the following java program segment
_______for (int i=0;i < n-2;i++)
_________for (int j=i+1;j < n-1; j++)
__________for (int k=j+1; k < n; k++)
_____________System.out.println(i + “ “ + j + “ “ k);
Q.how many times is the print statement executed? Explain your answer.
Can anyone here help me understand this please?
Thanks

Last edited: