Advertisement
hadi94

Fungsi Void

Feb 10th, 2015
7,425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream.h>
  2. #include <conio.h>
  3.  
  4. void luas(int &lu,int p,int l)
  5. {lu=p*l;}
  6.  
  7. main(){
  8.  
  9. int pj,lb,hsl;
  10.  
  11. cout<<"INI CONTOH FUNGSI VOID\n\n";
  12. cout<<"Panjang = ";cin>>pj;
  13. cout<<"Lebar = ";cin>>lb;
  14.  
  15. luas(hsl,pj,lb);
  16. cout<<"\nluas = "<<hsl;
  17.  
  18. getch();}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement