Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need help with a For loop that uses a Break statement

807598Feb 7 2006 — edited Feb 8 2006
I need to create a for loop which counts down from 100-50 and divides the number being counted down by a counter. Can anyone help me?
public class Break
 (
 
 public static void main ( String args []) (;
 
 	int total = 0
	int counter = 0
 	
	for { (int number = 100; total >=50; total --)
	if (counter == 0)
	break;
	} // end of for loop
	
	int output = number/counter
	system.out.printf("The number is" %d output/n)
	
	}// end of method main
}// end of class Break
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2006
Added on Feb 7 2006
20 comments
176 views