-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPinCode.java
More file actions
25 lines (21 loc) · 682 Bytes
/
PinCode.java
File metadata and controls
25 lines (21 loc) · 682 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
package whileGita;
import java.util.Scanner;
public class PinCode {
public static void main(String[] args) {
// pin code to'g'ri kiritilsa keyingi qadamga o'tilsin
Scanner scanner = new Scanner(System.in);
int MY_PIN_CODE = 1234;
int pinCode;
do {
System.out.print("Enter pin code: ");
pinCode = scanner.nextInt();
} while (pinCode != MY_PIN_CODE);
while (true) {
if (pinCode != MY_PIN_CODE) {
System.out.print("Enter pin code: ");
pinCode = scanner.nextInt();
} else break;
}
System.out.println("Xush kelibsiz");
}
}