C++ - Menghitung Luas dan Volume Balok
#include <conio.h>
#include <iostream.h>
#include <stdio.h>
main()
{
float p,l,t,luas,volume;
cout<<"=============================================== "<<endl;
cout<<"MENGHITUNG LUAS DAN VOLUME BALOK "<<endl;
cout<<"=============================================== "<<endl;
cout<<"Masukkan Panjang = " ; cin>>p;
cout<<"Masukkan Lebar = " ; cin>>l;
cout<<"Masukkan Tinggi = " ; cin>>t;
cout<<"=============================================== "<<endl;
//Rumus luas dan volume Balok
luas= 2*p*l + 2*p*t + 2*l*t;
volume= p*l*t;
cout<<"Luas balok= " <<luas <<endl;
cout<<"Volume balok= " <<volume <<endl;
getch();
}
Semoga Bermanfaat
0 komentar:
Post a Comment