# include <iostream.h>
double hasil ( int A, int B);
void main ()
{
int x,y;
double z;
cout<<" masukan nilai x : ";
cin>>x;
cout<<" masukan nilai y : ";
cin>>y;
z = hasil (x,y);
cout<< " hasil perkaliannya = ";
cout<< x << " x " << y << " = " << z;
}
double hasil (int A, int B)
{
return (A * B);
} // statement mengembalikan nilai
output
masukan nilai x : 1
masukan nilai y : 2
hasil perkaliannya = 1 x 2 = 2
Friday, 13 January 2012
CPP
0 Response to "contoh 32"
Post a Comment