Tugas 4.2

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> #include <iomanip> //Nama : Dendi Yusro Romadon //NIM : 3420230013 using namespace std; int main() { int alas, tinggi; float luas; 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 : Dendi Yusro Romadon\n"; cout << "HP : 0895415137346\n"; cout << "----------------------------------------\n"; return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines