Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program Menentukan Luas dan Keliling Persegi Panjang
- // Task No.1 file 066-P02.pptx
- // Amrul Mubarak Harahap
- // 19T03 - 1901098
- #include <iostream>
- using namespace std;
- int main(){
- float p, l, rumusLs, rumusKl;
- cout << "=======================================" << endl;
- cout << "Program Menghitung Luas Persegi Panjang" << endl;
- cout << "=======================================" << endl;
- cout << "Masukkan panjang : ";
- cin >> p;
- cout << "Masukkan lebar : ";
- cin >> l;
- rumusLs = p*l;
- rumusKl = (2*p) + (2*l);
- cout << "Luas persegi panjang dengan panjang = " << p << " cm dan lebar = " << l
- << " cm adalah " << rumusLs << " cm^2" << endl << endl;
- cout << "Keliling persegi panjang dengan panjang = " << p << " cm dan lebar = " << l
- << " cm adalah " << rumusKl << " cm" << endl << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement