Function C++

Source code :

#include <iostream>
#include <conio.h>
using namespace std;

int Luas(int x,int y){
int hasil;
hasil=x*y;
return hasil;
}
main(){
int p=0,l=0,k;
cout<<"Menghitung Luas Persegi 4"<<endl;
cout<<"Masukkan Panjang = ";cin>>p;
cout<<"Masukkan Lebar = ";cin>>l;
k=Luas(p,l);
cout<<endl<<"Luas = "<<k;
getch();
}

Output :

Share this

Related Posts

Previous
Next Post »