Tugas Program C++ penghitung luas dan volume tabung


#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    float phi, jari,ti,vol,lu;
    phi=3.14;
    cout<<" \n ========================================= "<<endl<<endl;
    cout<<" \n PROGRAM PENGHITUNG LUAS DAN VOLUME TABUNG "<<endl<<endl;
    cout<<" \n ========================================= "<<endl<<endl;
   
    cout<<" \n MASUKKAN JARI - JARI TABUNG = ";cin>>jari;
    cout<<" \n MASUKKAN TINGGI TABUNG      = ";cin>>ti;
   
    cout<<" \n =========================================\n"<<endl;
    cout<<" \n TERIMAKASIH ANDA TELAH MENGIKUTI PERINTAH "<<endl;
    cout<<" \n            DI ATAS HASIL              \n"<<endl;
    cout<<" \n =========================================\n"<<endl;
   
    vol=phi*jari*jari*ti;
    lu=2*phi*jari*ti;
   
    cout<<" \n VOLUME TABUNG = "<<vol<<"\t m3 \n"<<endl;
    cout<<" \n LUAS TABUNG   = "<<lu<<"\t m2 \n"<<endl;
   
    system("PAUSE");
    return EXIT_SUCCESS;
}

Hasil dari program di atas, seperti di bawah ini ;



Komentar

Postingan Populer