About

Wednesday, 18 January 2012

Program Menghitung Luas dan Keliling Lingkaran

# include <conio.h> 
# include <iostream.h> 
# include <math.h> // Mengaktifkan fungsi-fungsi matematika pada script program

main ()
{
float r,L,K;

clrscr();
cout <<"\n*******************************";
cout <<"\n* LUAS & KELILING LINGKARAN *";
cout <<"\n*******************************";
cout <<"\n\n";
cout <<"\nMasukkan jari-jari ! = "; cin >>r;
cout <<"\nphi = " <<M_PI; //M_PI adalah fungsi matematika (phi)

L=M_PI*r*r;
K=2*M_PI*r;

cout <<"\n\n";
cout <<"\n=========";
cout <<"\n= HASIL =";
cout <<"\n=========";
cout <<"\n\n";
cout <<"\nLuas = " <<L;
cout <<"\nKeliling = " <<K;

getch();
}

Baca Juga Artikel dibawah ini :

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons