forked from Kristian360/test1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile 1
More file actions
43 lines (37 loc) · 884 Bytes
/
file 1
File metadata and controls
43 lines (37 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package loops.pkg2;
import java.util.*;
/**
*
* @author 041312268
*/
public class Loops2 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
boolean asktocontinue;
int anumber;
int atotal = 0;
Scanner console = new Scanner (System.in);
asktocontinue = true;
do
{
anumber=console.nextInt();
if(anumber==0)
{
asktocontinue = false;
}
else
{
atotal +=anumber;
}
}
while(asktocontinue);
System.out.print("your total is"+atotal);
}
}