#include <iostream.h>
#include <conio.h>
#include <math.h>
void main()
{
int *a=new int;
int *b=new int;
int *c=new int;
int pilih;
int menu;
do{
clrscr();
cout<<"menu pilihan"<<endl;
cout<<"1.keliling & luas segitiga siku-siku"<<endl;
cout<<"2.volume & luas bola"<<endl;
cout<<"3.keluar"<<endl;
cout<<"masukkan pilihannya:";
cin>>pilih;
switch (pilih) {
case 1:cout<<"hitung segitiga"<<endl;
cout<<"alas segitiga:";
cin>>*a;
cout<<"tinggi segitiga:";
cin>>*b;
*c=sqrt((*a**a)+(*b**b));
cout<<"keliling segitiga:"<<*a+*b+*c<<endl;
cout<<"Luas segitiga:"<<1.5**a**b;
break;
case 2: cout<< "hitung bola"<<endl;
cout <<"Jari - Jari : ";
cin>>*a;
cout << "Volume : "<<((4/3)*3.14**a**a**a)<<endl;
cout << "Luas Selimut : "<<(4*3.14**a**a)<<endl;
break;
}
getch();
}
while(pilih!=3);
getch();
delete a,b,c;
}
Sign up here with your email
ConversionConversion EmoticonEmoticon