Warung Online

March 24, 2012

C++ FUNCTION

//program_function
#include<iostream>

using namespace std;

void jumlah(int a,int b,int c){
cout<<" Penjumlahan"<<endl<<" Bil. 1 : ";
cin>>a;
cout<<" Bilangan 2 : ";
cin>>b;
c=a+b;
cout<<" Hasil = "<<a<<"+"<<b<<" = "<<c<<endl;

}

int main(){
int x,y,z;
system("cls");
cout<<"Program Fungsi"<<endl<<endl;
jumlah(x,y,z);

system("pause");
return 0;
}