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();
}

Posted in . Bookmark the permalink. RSS feed for this post.

Leave a Reply

Search

Support by Blogger ITN | Converted by LiteThemes.com