• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Loops??

 
srikanth reddy
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


please help me with the process...iam getting 8,5...


here what happens when break and continue of if statement is executed??
[ October 20, 2005: Message edited by: srikanth reddy ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By adding some System.out.printlns and making it prettier.



Hope that helps.

I' never can understand why comd eCODE tags has the text small and some larger.

Mark
[ October 20, 2005: Message edited by: Mark Spritzler ]
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Running in a different low priority thread to Mark (on paper ) I reckon you just forgot that after the last comparison i++ < j-- jumped out of the loop, i and j had been incremented respectively decremented. That is 8,5 gets you out of the loop but then i is 9 and j is 4. Makes you dizzy eh?

Actually I had problems doing one like this on the real exam - at the same time there were three people trying to get the PC next to me working.
 
srikanth reddy
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
barry i didnt get u ....try to get pc means...
also barry if these sort of questions comes on exam in 1 means fine ..but if they are many i shall go mad ..also yesterday i was doing these dan questions ..i was right almost all..but my head was roaming here and there ...u got it what i mean ???
 
Joseph Clark
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we bring pencil and scratch paper to the test? I can do these problems quicker if I can write down what happens in the iterations.
 
Ray Horn
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The testing center will provide pencil & paper. Not allowed to bring your own. I had to also check my jacket. Nothing else allowed in (bags, cell phones, etc).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic