#include <stdio.h>
#include <stdlib.h>
int main () {
//deklarasi variable
const float pi = 3.14;
float r, l, k;
//judul program
printf("program menghitung luas dan keliling lingkaran\n\n");
//input
printf("masukan jari-jari lingkaran: "); scanf("%f",&r);
//proses
l=pi*r*r;
k=pi*2*r;
//output
printf("\nLuas = %.2f x %.2f^2 = %.2f\n",pi,r,l);
printf("\nKeliling = %.2f x 2 x %.2f = %.2f\n",pi,r,k);
printf("\n\n");
system ("pause");
return (0);
}
/*By D-JokerZzZ*/
0 komentar:
Posting Komentar