Senin, 22 Oktober 2012

C++ Fungsi

#include <iostream.h>
#include <conio.h>
double hasil (int A, int B) ;

void main ()
{
    int x,y ;
   double z;

   cout << "masukkan Nilai x : ";
   cin >> x;

   cout << "masukkan Nilai y : ";
   cin >> y;

   z = hasil (x,y) ;

   cout << "hasil perkalian = ";
   cout << x << "x" << y << " = " << z;


getch ();
}

double hasil (int A, int B)
{
    return ( A * B);
}

0 comments:

Posting Komentar