468x60 Ads

free counters

contoh program rekursif C++

#include
#include

float TauGa(int A,int B)
{
if(B==0)
{
return 1;
}
else
{
return A*TauGa(A,B-1);
}
system("pause");
}

int main()
{ int A,B;
printf("masukan nilai yang akan dipangkatkan:");scanf("%d",&A);
printf("masukan pangkat:");scanf("%d",&B);
printf("%f",TauGa(A,B));
system("pause");
return 0;
}

0 komentar:

Posting Komentar

 
Impossible is Nothing © 2011 Theme made with the special support of Maiahost for their cheap WordPress hosting services and free support.