#include <iostream>
using namespace std;
//Nama : Ramdika Rovansah
//Nim : 3420230027
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: Ramdika Rovansah"<<endl;
cout<<"Email\t: ramdika@gmail.com"<<endl;
cout<<"Nama\t: Ramdika Rovansah"<<endl;
cout<<"Email\t: ramdika@gmail.com"<<endl;
cout<<"Nama\t: Ramdika Rovansah"<<endl;
cout<<"Email\t: ramdika@gmail.com"<<endl;
cout<<"Nama\t: Ramdika Rovansah"<<endl;
cout<<"Email\t: ramdika@gmail.com"<<endl;
return 0;
}