Rabu, 04 April 2012

c++ Volume bola

#include <iostream.h>

class v_bola {

public:

void volume();

void rumus();

private:

float v,r;

};

void v_bola::volume(){

cout<<"Program menghitung volume bola"<<endl;

cout<<"nilai r : "; cin>>r;

}

void v_bola::rumus(){

v=4/3*(3.14*r*r*r);

cout<<"Volume Bola = " << v;

cout<<endl;

}

int main(){

v_bola x;

x.volume();

x.rumus();
system ("PAUSE");
return 0;

}

Komentar :

ada 0 komentar ke “c++ Volume bola”

Posting Komentar

Pengikut

Total Tayangan Halaman

 
This Blog is proudly powered by Blogger.com | Template by Harry wahyu saputra