Menghitung Luas & Volume Tabung

Posted: April 17, 2010 in Daspro
Tags:

#include<stdio.h>

#include<iostream.h>

#include<conio.h>

void main()

{

const float phi = 3.141592;

float jari_jari_lingkaran, tinggi_tabung, luas_tabung, volume_tabung;

clrscr();

cout<<“Latihan 2″<<endl;

cout<<“Masukan jari-jari lingkaran tabung : “;

cin>>jari_jari_lingkaran;

cout<<“Masukan tinggi tabung : “;

cin>>tinggi_tabung;

luas_tabung=(phi*jari_jari_lingkaran*2)*(tinggi_tabung*jari_jari_lingkaran);

volume_tabung=phi*jari_jari_lingkaran*jari_jari_lingkaran*tinggi_tabung;

cout<<“Luas Tabung : “<<luas_tabung<<” cm”<<endl;

cout<<“Volume Tabung : “<<volume_tabung<<” cm”<<endl;

getch();

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s