D4n9k3l's Blog
Just another WordPress.com weblog

Mengitung Luas & Keliling Lingkaran Menggunakan Fungsi

Listing Program :

#include
#include
#include
#include
#define phi 3.14
garis()
{
cout<<"====================================="<<endl;
}
float luas(int r)
{
float l;
l = phi * r * r;
return l;
}
float kel(int r)
{
float k;
k = 2 * phi * r;
return k;
}
void main()
{
float kll, ls;
int k, l;
int r,kode;
char lg;
d3d1:
clrscr();
garis();
cout<<"Perhitungan Keliling & Luas Lingkaran"<<endl;
garis();
cout<>r;
kll = kel(r);
ls = luas(r);
cout<>kode;
if (kode==1)
{cout<<"Keliling : "<<kll<<endl;}
else if (kode==2)
{cout<<"Luas : "<<ls<<endl;}
else
{cout<<"Error…!!!"<<endl;}
garis();
cout<>lg;
if (lg==’Y’||lg==’y’)
goto d3d1;
}

Tampilan Program :

1
2

Satu Tanggapan to “Mengitung Luas & Keliling Lingkaran Menggunakan Fungsi”

  1. Sip . Thanks comentnya bos.
    Include nya blm nungul boz


Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: