-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhileLoop.java
More file actions
46 lines (31 loc) · 996 Bytes
/
Copy pathwhileLoop.java
File metadata and controls
46 lines (31 loc) · 996 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
44
45
46
public class whileLoop {
public static void main(String[] args) {
//print number from 0 to 49 ie 50
// int i=0;
// while(i<50){
// System.out.println(i);
// i = i+1;
// }
//print number from 1 to 50
// int i=1;
// while(i<=50){
// System.out.println(i);
// i = i+1;
// }
//Print number from 50 to 5 in descending order
// int count = 50;
// while(count >= 5){
// System.out.println(count);
// // count = count - 1;
// count--;
// }
// Get input from user multiple times using While Loop
// Scanner input = new Scanner(System.in);
// int i = 0;
// while(i<3){
// int getNumber = input.nextInt();
// System.out.println("Number is : "+getNumber);
// i++;
// }
}
}