Sabtu, 17 April 2010

Cpp parameter

#include

void hitung(int a, int b, int *c){

*c = a + b;
printf("dalam prosedur : hasil penjumlahan : %d\n", *c);

}

int main(){

int operan1 = 2;
int operan2 = 3;
int hasil = 0;
hitung(operan1, operan2, &hasil);

printf("setelah prosedur : nilai hasil : %d\n", hasil);

return 0;

}