Sunday, 2 October 2016

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
Comments
0 Comments

0 comments:

Post a Comment

  © Ratna-Always For You The Transformers by Blog Tips And Trick 2009