aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Flow control (For loop) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Flow control (For loop)" Watch "Flow control (For loop)" New topic
Author

Flow control (For loop)

vinita Kh
Ranch Hand

Joined: Feb 19, 2002
Posts: 49
In the following code y its prints out
"Total 0"
instead of
"i=0 ; j =10"
"i=1" : j = 9"
"i = 2 :j = 8"
"Total 30"

[ Added UBB CODE tags ]
[ May 07, 2002: Message edited by: Jessica Sant ]
Ashish Hareet
Ranch Hand

Joined: Jul 14, 2001
Posts: 375
The total at the start of the for loop is less than 30 ( zero ) so the code never get's into the for loop & you get zero as your output .
Ashish
vinita Kh
Ranch Hand

Joined: Feb 19, 2002
Posts: 49
oops!!
very silly mistake!
thanks Aashish.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Flow control (For loop)