Categories
Pemprogramman C++

contoh program sederhana switch c++

Kali ini saya akan share contoh program sederhana switch case dengan bahasa c++ semoga apa yang kami share bermanfaat bagi teman-teman semua.

#include <iostream>
using namespace std;
main()
{
 int makassar;
 cout<<"enter a number to makassar [1/2/3]=";
 cin>>makassar;

 switch (makassar)
 {
  case 1:
  cout<<"se're";
  break;
  case 2:
  cout<<"rua";
  break;
  case 3:
  cout<<"tallu";
  break;
  default:
  cout<<"tena kuassengi";
  break;
 }
}

Leave a Reply

Your email address will not be published. Required fields are marked *