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
What is the difference between c &c++?
What is openmp in c?
Are pointers integers in c?
how to find binary of number?
Explain what does the function toupper() do?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
FILE PROGRAMMING
What is the difference between a string and an array?
Which type of language is c?
What is the use of f in c?
What is stack in c?
What is a nested loop?
Explain that why C is procedural?
What are shell structures used for?