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
Tell us the use of fflush() function in c language?
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
When would you use a pointer to a function?
Suggesting that there can be 62 seconds in a minute?
write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a
Why double pointer is used in c?
Why is it important to memset a variable, immediately after allocating memory to it ?
What are pointers? What are stacks and queues?
How do we make a global variable accessible across files? Explain the extern keyword?
What is the use of gets and puts?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
Explain what are multibyte characters?
Is c procedural or object oriented?
Explain enumerated types.
Why doesnt that code work?