Advertisement
PakRT

Percabangan lebih dari 2 kondisi

Feb 25th, 2020
2,502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main () {
  5. int input;
  6.  
  7. cout<<"Pilihlah tempat wisata yang menurut anda menarik :"<<endl;
  8. cout<<"1. Pantai Senggigi"<<endl;
  9. cout<<"2. Pantai Kuta"<<endl;
  10. cout<<"3. Gili Kondo"<<endl;
  11. cout<<"Masukkan Wisata Yang anda Pilih :";
  12. cin>>input;
  13.  
  14. if (input==1) {
  15. cout<<"Anda memilih Pantai senggigi";
  16. }
  17. else if (input==2) {
  18. cout<<"Anda memilih Pantai Pink";
  19. } else if (input==3) {
  20. cout<<"Anda memilih gili Tanjung";
  21. } else
  22. cout<<"Mohon maaf tidak ada didaftar";
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement