#include <iostream.h>
#include <conio.h>
#include <math.h>
int main()
{
int a,sisi,luas,kel;
cout<<"1. luas persegi "<<endl;
cout<<"2. keliling persegi "<<endl;
cout<<"3. keluar "<<endl;
cout<<"masukkan pilihan anda = ";cin>>a;
cout<<"masukkan sisi persegi = ";cin>>sisi;
switch(a)
{
case 1 :
luas=pow(sisi,2);
cout<<"maka luasnya = "<<luas;
break;
case 2 :
kel= 4*sisi;
cout<<"maka keliling = "<<kel;
break;
default:
goto exit;
}
exit:
getch();
}
0 comments:
Post a Comment