Program Sederhana menentukan Volume dan Luas Bola Dengan C++

/*
Nama : Rahman
NIM : 171011401798
Kelas : 02 TPLE 021
*/
#include “StdAfx.h”
#include <iostream>
using namespace std;

main() {

float r, phi, volume, luas;
cout<<“====================================================”<<endl;
cout<<“masukan jai-jari : “,cin>>r;
cout<<“====================================================”<<endl;
phi=3.14;
volume=4/3*phi*r*r*r;
luas=4*phi*r*r;
cout<<“Volume bola adalah : “<<volume<<endl;
cout<<“Luas bola adalah : “<<luas<<endl;
cout<<“====================================================”<<endl;

}

 

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s