-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnested_if_statement.cpp
More file actions
48 lines (43 loc) · 1.1 KB
/
nested_if_statement.cpp
File metadata and controls
48 lines (43 loc) · 1.1 KB
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
47
48
// if (kondisi) {
// if (kondisi) {
// askdoakosd
// } else {
// oawkoakoakw
// }
// }
#include <iostream>
#include <string>
int main() {
/*int usia;*/
/*std::cout << "masukkan usia kamua: ";*/
/*std::cin >> usia;*/
/**/
/*if (usia >= 0) {*/
/* if (usia < 13) {*/
/* std::cout << "kamu masih bocil " << std::endl;*/
/* } else if (usia >= 13 && usia <= 19) {*/
/* std::cout << "kamu sudah remaja " << std::endl;*/
/* } else {*/
/* std::cout << "kamu sudah dewasa" << std::endl;*/
/* }*/
/*} else {*/
/* std::cout << "hey usia tidak valid karena kamu memasukkan angka " <<
* usia*/
/* << std::endl;*/
/*}*/
std::string username, password;
std::cout << "masukkan username: ";
std::cin >> username;
if (username == "admin") {
std::cout << "masukkan password: ";
std::cin >> password;
if (password == "445") {
std::cout << "hey kamu berhasil login " << std::endl;
} else {
std::cout << "password salah !" << std::endl;
}
} else {
std::cout << "username tidak dikenal" << std::endl;
}
return 0;
}