Menghitung Volume Kubus C++
program menghitung volume kubus:
//menghitung volume kubus.cpp
#include <iostream>
using namespace std;
int main()
{
const int N=10;
float sisi, volume;
char off;
cout << "Masukkan sisi tabung : ";
cin >> sisi;
volume = sisi*sisi*sisi;
cout << "volume = " << volume << '\n';
cin >> off;
return 0;
}
//menghitung volume kubus.cpp
#include <iostream>
using namespace std;
int main()
{
const int N=10;
float sisi, volume;
char off;
cout << "Masukkan sisi tabung : ";
cin >> sisi;
volume = sisi*sisi*sisi;
cout << "volume = " << volume << '\n';
cin >> off;
return 0;
}
No comments: