Buatlah sebuah program utk menghitung luas persegi panjang, nilai panjang & lebar dimasukan melalui keyboard sedangkan besar nilai luas muncul secara otomatis
zelen
Ini ane dapat dari hasil searching pakai google
//Program by YAN AJIE PRASETIA #include<iostream.h> #include<conio.h> void main() { clrscr(); int x,y,z; cout<<"====PROGRAM MENGHITUNG LUAS PERSEGI PANJANG====\n"; cout<<"Masukkan Nilai Panjang : "; cin>>x; cout<<"Masukkan Nilai Lebar : "; cin>>y; z = x * y; cout<<endl; cout<<"===============================================\n"; cout<<"Nilai Panjang : "<<x<<endl; cout<<"Nilai Lebar : "<<y<<endl; cout<<"Luas P x L : "<<z<<endl; cout<<"==============================================="; getch(); }
//Program by YAN AJIE PRASETIA
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x,y,z;
cout<<"====PROGRAM MENGHITUNG LUAS PERSEGI PANJANG====\n";
cout<<"Masukkan Nilai Panjang : "; cin>>x;
cout<<"Masukkan Nilai Lebar : "; cin>>y;
z = x * y;
cout<<endl;
cout<<"===============================================\n";
cout<<"Nilai Panjang : "<<x<<endl;
cout<<"Nilai Lebar : "<<y<<endl;
cout<<"Luas P x L : "<<z<<endl;
cout<<"===============================================";
getch();
}