recurtion

hi
i have question that with the recursive function,multiply two number with using plus and dont use the sign of multiple?
thanks
Last edited on
Sounds like you're looking for a for loop. 2 * 3 = 2 + 2 + 2 kind of thing.
you know i solve this problem as a primery algorithem like this solution you said but i am wondering how could i involve recurtion??
using namespace std;

int main()
{
int sum=0,a,b;
int i;
cout<<"\nenter 2 number:";
cin>>a>>b;
if(a<b){
for(i=1;i<=b;i++)
sum+=a;
cout<<"\nthe sum is:"<<sum;
}
else if(a>b){
for(i=1;i<=a;i++)
sum+=b;
cout<<"\nthe sum is "<<sum;
}
return 0;
}
this is my solve but how to use recurtion?
A loop IS recursion. Are you looking for a recursive function?
yes sorry for not understanding ,i mean recursive function,
Topic archived. No new replies allowed.