C++ Menghitung Volume Air Tumpah

//lh3.googleusercontent.com/-K5UKWzgJhmU/AAAAAAAAAAI/AAAAAAAACdI/CN3nwiBZsGE/s512-c/photo.jpg
November 19, 2016





c++ di sampng sangat membantu untuk mengitung volume air. mungkin sobat bisa mencobanya sendiri. saya langsung kodingannya aja.

 #include <iostream>
#include <conio.h>
#include <stdio.h>
using namespace std;
int main()
{
    const float phi = 3.14;
    float ta,tt,ka,tk;
    double vt,vk;
    double hasil,liter;
    cout<<"===============> Menghitung Air Yang Tumpah <===============\n";
    cout<<"Masukkan Nilai Alas Ember = ";
    cin>>ta;
    cout<<"Masukkan Nilai Tinggi Ember = ";
    cin>>tt;
    cout<<"Masukkan Nilai Alas Kerucut = ";
    cin>>ka;
    cout<<"Masukkan Nilai Alas Kerucut = ";
    cin>>tk;
     vt= phi*ta*ta*tt;
     vk= phi/3 *ka*ka*tk;
     hasil= vt-vk;
     liter=hasil/1000;
     cout<<"========================================\n";
     cout<<" Volume Ember = "<<vt<<"\n";
     cout<<" Volume Kerucut = "<<vk<<"\n";
     cout<<" Jumlah Air Yang Tumpah = "<<liter<<" L ";
     getch();
}


Related Post

SUBSCRIBE TO OUR NEWSLETTER

closed