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 me can the size of an array be declared at runtime?
Why can’t we compare structures?
Why & is used in scanf in c?
What is #include called?
how can I convert a string to a number?
What is your stream meaning?
How can a number be converted to a string?
What is the difference between %d and %i?
What is the purpose of scanf() and printf() functions?
void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply
What are qualifiers and modifiers c?
What is a double c?
What does %c do in c?
Do you know the difference between malloc() and calloc() function?
What does return 1 means in c?