Iterative Step:
for(int i=0;i<5;i++)
cout<<“mencoba rekursi\n”;
Rekursive Step:
void coba(int i)
{if(i==5)
{}
else
cout<<“mencoba rekursi\n”;coba i+1;
}
main()
{int i=0;
coba(i);
}
B.REKURSIVE TO ITERATIVE
Rekursive Step:
void coba(int i)
{if(i==5)
{}
else
cout<<“mencoba rekursi\n”;coba i+1;
}
main()
{int i=0;
coba(i);
}
Iterative Step:
for(int i=0;i<5;i++)
cout<<“mencoba rekursi\n”;
0 comments:
Posting Komentar