Reset author name to chosen name ✨
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package lab12_chloefontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author chloe
|
||||
*/
|
||||
public class TestBreak1 {
|
||||
public static void main(String[] args) {
|
||||
int sum = 0,
|
||||
number = 0;
|
||||
|
||||
while (number < 20) {
|
||||
if (sum >= 100) {
|
||||
break;
|
||||
}
|
||||
number++;
|
||||
sum += number;
|
||||
System.out.println("Current sum: " + sum);
|
||||
}
|
||||
|
||||
System.out.println("\nThe number is " + number);
|
||||
System.out.println("The sum is " + sum);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user