Algoritma 6.1

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; int main() { char kode; cout<< "-------------------------------------"<<endl; cout<< "\tLatihan Switch Case"<<endl; cout<< "-------------------------------------"<<endl; cout<< "Masukan Code Barang [A/B/C]:\n", kode; cin>>kode; printf("Kode yang dipilih: %c\n", kode); switch (kode) { case 'A': case 'a': cout<<"Alat Olahraga"; break; case 'B': case 'b': cout<<"Alat Elektronik"; break; case 'C': case 'c': cout<<"Alat Masak"; break; default: cout<<"Anda salah memasukan kode"; } cout<<'\n'; cout<< "-------------------------------------"<<endl; char nama[20] = "Ramdika Rovansah"; char email[30] = "ramdika33@gmail.com"; printf("Nama\t: %s\n", nama); printf("Email\t: %s\n", email); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines