Berlangganan

About Me


contoh 32

# 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

0 Response to "contoh 32"

Post a Comment