wtite a program that will multiply two integers in recursion
function

Answer Posted / mohit taneja

int mul(int n)
{
static int num;
printf("enter the number");
scanf("%d",&num);
if(n==1)
{
return num;
}
else
{
num=num*mul(n-1);
}
return num;
}

void main()
{
int n,result;
printf("enter the number of digit u want to multiply");
scanf("%d",&n);
int result=mul(n);
printf("multiplication=%d",result);
getch();
}

Is This Answer Correct ?    13 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we replace the struct function in tree syntax with a union?

768


Explain threaded binary trees?

670


What is the symbol indicated the c-preprocessor?

686


What are conditional operators in C?

616


Explain how can you check to see whether a symbol is defined?

652






Differentiate between a for loop and a while loop? What are it uses?

658


How can I find the modification date and time of a file?

596


Describe wild pointers in c?

629


write a program to print data of 5 five students with structures?

1598


in iso what are the common technological language?

1624


What is a lookup table in c?

618


What are actual arguments?

639


What is scope of variable in c?

551


What is declaration and definition in c?

517


What are the rules for the identifier?

660