Luas Dan Keliling Lingkaran


#include <iostream.h>
#include <conio.h>
#define phi 3.14

float luas_lingkaran (float r)
{
      float t;
      t=phi*(r*r);
      return(t);
}
float kel_lingkaran(float r)
{
      float t;
      t=2*phi*r;
      return(t);
}

main()
{
      float z,d,y;
      cout<<"Masukan Nilai Jari-jari=";
      cin>>y;
      cout<<"Contoh Pemrograman Fungsi"<<endl<<endl;
      z=luas_lingkaran(y);
      d=kel_lingkaran(y);
      cout<<endl;
      cout<<"Hasil Luas Lingkaran:"<<phi<<"*"<<y<<"*"<<y<<"="<<z<<endl;
      cout<<"Hasil Keliling Lingkaran:2*"<<phi<<"*"<<y<<"="<<d<<endl;
      getch();
}

Comments

Popular posts from this blog

Animasi Lucu C++

Forum Anak Nasional

DDL Part II