pls help me.. i need to make a program using recursion.. for example.. user will input 3+2.. the concept of recursion should be 3+1+1 and that the program will output 5.. same as in multiplication..example: input:2*3..concept of recursion:2+2+2 as well as in subtraction:ex:4-2 concept:4-1-1..output=2 and in division..input:4/2 output:2 concept:4-2-2.. pls...
ok.. this is all ive done..(just only for addition)
#include <iostream.h>
#include <conio.h>
int add(int n;int m);
int main()
{
int num1,num2;
add(num1,num2);
return 0;
}
int add(int n;int m)
{
int N
if(m==1)
for(N=1;N<=m;N++)
cout<<N;
else
return n+add(n;m=1)
}
pls help..
Uh, I don't see how that could possibly be recursion. Recursion is the concept of a function calling itself up to a certain point to simplify the execution of an otherwise lengthier code block.