9.2al

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> #include <cstring> #include <stdio.h> using namespace std; void garis (){ puts("================================================="); } void ttd (char nama[20],char email[20]){ cout<<"Nama\t: "<<nama<<endl; cout<<"Email\t: "<<email<<endl; } void program_strlen(){ char nama[20] ="Zacky Ahmad S"; garis(); puts("\tContoh Program Strlen"); garis(); cout<<"Nama anda masukan adalah "<<nama<<endl; cout<<"Jumlah karakternya adalah "<<strlen(nama)<<endl; } void program_strcmp(){ garis(); puts("\tContoh Programp Strcmp"); garis(); char a1[]="s";char a2[]="S"; char b1[]="s"; cout<<"Hasil perbandingan "<<a1<<" dan "<<a2<<" -> ";cout<<strcmp(a1,a2)<<endl; cout<<"Hasil perbandingan "<<a2<<" dan "<<a1<<" -> ";cout<<strcmp(a2,a1)<<endl; cout<<"Hasil perbandingan "<<a1<<" dan "<<b1<<" -> ";cout<<strcmp(a1,b1)<<endl; } int main() { int pilih; printf ("Silahkan pilih program [1/2]:");cin>>pilih; cout<<endl; if (pilih == 1){ program_strlen(); }else if (pilih==2){ program_strcmp(); }else { puts("Maaf pilihan anda salah..."); } garis(); ttd ("Zacky","zackyahmadsyahputra4@gmail.com"); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines