#include <iostream>
using namespace std;
int main() {
int panjang;
int lebar;
int mode;
puts ("==============================================");
cout<<"\tProgram Percabangan Persegi"<<endl;
puts ("==============================================");
cout<<"Masukan Panjang Persegi :"<<endl;
cin>>panjang;
cout<<"Masukan Lebar Persegi :"<<endl;
cin>>lebar;
puts ("==============================================");
cout<<"Masukan Mode"<<endl;
cin>>mode;
cout<<"[1:Luas, 2:Keliling]\t:"<<endl;
cout<<"Panjang persegi adalah\t: "<<panjang<<endl;
cout<<"Lebar Persegi adalah\t: "<<lebar<<endl;
if (mode == 1) {
cout<<"Mode yang dipilih adalah Luas"<<endl;
int luas = panjang * lebar;
cout<<"Luas Persegi adalah\t:"<<luas<<endl;
} else if (mode == 2) {
cout<<"Mode yang dipilih adalah keliling"<<endl;
int keliling = 2 * (panjang + lebar);
cout<<"Keliling Persegi adalah\t:"<<keliling<<endl;
} else {
cout << "Mode tidak valid"<<endl;
}
puts ("==============================================");
cout<<"Nama\t: Muhammad Chairul Ramadhani"<<endl;
cout<<"Email\t: IrulMuhammad50@gmail.com"<<endl;
cout<<"\nNama = Muhammad Chairul Ramadhani"<<endl;
cout<<"Nim = 1620230015";
return 0;
}