Sunday, June 26, 2011

C Programming - Program Mencari Volume Kerucut


#include <stdio.h>
#define PI 22/7

int main()
{
  printf("Menghitung Volume Kerucut\n\n");
  double jarijari, tinggi, volume;
  printf("Masukkan nilai jari-jari : ");
  scanf("%lf", &amp;jarijari);
  printf("Masukkan nilai tinggi : ");
  scanf("%lf", &amp;tinggi);

  volume = (PI * jarijari * jarijari * tinggi) / 3.0;

  printf("\nVolume kerucut adalah %.2lf satuan volume\n", volume);

  return 0;
}

No comments:

Post a Comment

LinkWithin

Related Posts Plugin for WordPress, Blogger...