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

Dans Questions : logic

 
Kristof Camelbeke
Ranch Hand
Posts: 97
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Answer : prints 61433
I've tested this prog. and indeed it prints 61433 ; I just don't know why he prints the last 3 because at that time x=3 and the loop should stop, no ?
Stupid question but I just don't get it...
 
Vicken Karaoghlanian
Ranch Hand
Posts: 522
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kristof, the first time it prints 3 the value of success is 1, the second iteration the (x != 3) returns false however (success < 2) return true, which allows one more iteration of the loop, thus printing 3 and then exiting.
Hope this helps.
 
Kristof Camelbeke
Ranch Hand
Posts: 97
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes... I guess I was blind for a moment
thanx !
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic