#include <cstdlib>
#include <iostream>
#include <conio.h>
using namespace std;
void luas(int p,int l){
int hasil;
hasil=p*l;
cout<<"Luas Persegi Panjang : "<<hasil<<endl;
}
void kel(int p,int l){
int hasil;
hasil=2*(p+l);
cout<<"Keliling persegi panjang : "<<hasil<<endl;
}
void luas(int r){
int hasil,phi;
phi=3,14;
hasil=phi*r*r;
cout<<"Hasil luas lingkaran : "<<hasil<<endl;
}
void kel(int r){
int hasil,phi;
phi=3,14;
hasil=2*phi*r;
cout<<"Keliling lingkaran : "<<hasil<<endl;
}
int main(int argc, char *argv[])
{
int a,b;
cout<<"|========================|\n";
cout<<"| Mencari Luas Persegi |\n";
cout<<"| Panjang |\n";
cout<<"|========================|\n";
cout<<"Masukkan Panjang : ";cin>>a;
cout<<"Masukkan Lebar \t: ";cin>>b;
luas(a,b);
int c,d;
cout<<"|==========================|\n";
cout<<"| Mencari Keliling Persegi |\n";
cout<<"| Panjang |\n";
cout<<"|==========================|\n";
cout<<"Masukkan lebar persegi \t: ";cin>>c;
cout<<"Masukkan panjang persegi : ";cin>>d;
kel(c,d);
int r;
cout<<"|=========================|\n";
cout<<"| Program Menghitung Luas |\n";
cout<<"| Lingkaran |\n";
cout<<"|=========================|\n";
cout<<"Masukkan jari-jari : ";cin>>r;
luas(r);
int s;
cout<<"|=============================|\n";
cout<<"| Program Menghitung Keliling |\n";
cout<<"| Lingkaran |\n";
cout<<"|=============================|\n";
cout<<"Masukkan jari-jari : ";cin>>s;
kel(s);
system("pause");
return 0;
}
Tidak ada komentar:
Posting Komentar