tugas4.2

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> #include <iomanip> using namespace std; int main() { int alas, tinggi; float luas; //NAMA: MOH. HAMDA KHOIRO AFWA //NIM: 3420230022 cout << "----------------------------------------\n"; cout << "Program Menghitung Luas Segitiga\n"; cout << "----------------------------------------\n"; cout << "Masukan nilai alas segitiga : \n"; cin >> alas; cout << "Masukan nilai tinggi segitiga : \n"; cin >> tinggi; cout << "----------------------------------------"; luas = (alas * tinggi) * 0.5; cout << "\nLuas Segitiga = (Alas * Tinggi) * 0.5\n"; cout << "Luas Segitiga = (" << alas << " * " << tinggi << ") * 0.5\n"; cout << fixed << setprecision(2); // Mengatur presisi 2 angka di belakang koma cout << "Luas segitiga = " << luas << "\n"; cout << "----------------------------------------\n"; cout << "Nama\t: Moh. Hamda Khoiro Afwa\n"; cout << "HP\t: 08999242519\n"; cout << "----------------------------------------\n"; return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines