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

Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

1770


what is the diffrenet bettwen HTTP and internet protocol

1396


What is the total generic pointer type?

731


What's the total generic pointer type?

619


What is bubble sort technique in c?

594






What is switch in c?

651


why programs in c are running with out #include? some warnings are display in terminal but we execute the program we get answer why? eg: main() { printf("hello world "); }

1320


Explain how can I open a file so that other programs can update it at the same time?

598


What should malloc() do?

649


Explain enumerated types in c language?

608


Explain how can you avoid including a header more than once?

607


What are the types of type qualifiers in c?

652


What are the types of operators in c?

616


What is function prototype?

613


Define Array of pointers.

637