File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question from jqplus

 
Sandhya Lever
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
class Test
{
public static void main(String args[])
{
int c = 0;
A: for(int i = 0; i < 2; i++)
{
B: for(int j = 0; j < 2; j++)
{

C: for(int k = 0; k < 3; k++)
{
c++;
if(k>j) break;
}

}
}
System.out.println(c);
}
}


Options

Select 1 correct option.

7

8

9

10

11



Here the correct answer is 10.Please help me understand the output of this code.
Regards,
Sandhya
 
Ramya Iyer
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ October 06, 2005: Message edited by: Ramya Iyer ]
 
Sandhya Lever
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,Ramya
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic