#include <iostream>
using namespace std;
//Nama : Alip Rizki Firnansah
//Nim : 3420230040
int main() {
int panjang;
int lebar;
int mode;
cout<<"==========================================="<<endl;
cout<<"\tProgram Percabangan Persegi"<<endl;
cout<<"==========================================="<<endl;
cout<<"Masukan Panjang Persegi :"<<endl;
cin>>panjang;
cout<<"Masukan Lebar Persegi :"<<endl;
cin>>lebar;
cout<<"==========================================="<<endl;
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;
}
cout<<"==========================================="<<endl;
cout<<"Nama\t: Alip Rizki Firnansah"<<endl;
cout<<"Email\t: aliprizkifirnansah1@gmail.com"<<endl;
cout<<"==========================================="<<endl;
return 0;
}