program perkalian (a,n) ke dalam definisi penjumlahan secara rekursif.

hayoo,, pasti lagi cari referensi ya?
yaudah langsung aja di eksekusi source code dibawah ini gan.
semoga bermanfaat ya... :D

#include <iostream>

using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int kali(int i, int j){
if(j==0)
return 0;
else
return i+kali(i,j-1);
}

main() {
int a,b;
cout<<"Bentuk perkalian (a,n) ke dalam defini penjumlahan secara rekursif"<<endl;
cout<<"masukkan bilangan pertama : ";
cin>>a;
cout<<"masukkan bilangan kedua : ";
cin>>b;
cout<<"hasil = "<<kali(a,b);

return 0;
}

Share on Google Plus

About Luthfi

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 komentar:

Posting Komentar