What is indirect recursion? give an example?

Answers were Sorted based on User's Feedback



What is indirect recursion? give an example?..

Answer / hussain

void fun1()
{
static i=0;
if(i<5)
fun2();
}
void fun2()
{
printf("Recursion from fun2 to fun1 which is indirect
recursion\n");
fun1();
}
main()
{
fun1();
}

Is This Answer Correct ?    52 Yes 20 No

What is indirect recursion? give an example?..

Answer / vishwanath pillay

void f1()
{
.....
if(condition)
{
f2();
....
}
}
void f2()
{
....
....
f1();
}

void main()
{
f1();
}


On closer look u'll find that the program goes lopping
itself again and again untill the condition in satified.
Once the cond. is met it will exit the loop and terminate
the prog.
But there is 1 important thing that:- the func's call is
indirect.
this is Indirect Recurssion.

Is This Answer Correct ?    29 Yes 7 No

What is indirect recursion? give an example?..

Answer / deepak verma

in c programing language in indirect recursion there are two function ,but when one function call to second and second call to first under condtion .when condition is false then the function is terminate.

Is This Answer Correct ?    5 Yes 4 No

What is indirect recursion? give an example?..

Answer / j j ramesh / ap / mca / jjcet

void fun1();
void fun2();
int i=0;

void main()
{
clrscr();
printf("\n\n\n");

fun1();

getch();
}

void fun2()
{
if(i<5)
{
printf("Recursion from fun2 to fun1 which is indirect
recursion\n");
i++;
fun1();
}
}
void fun1()
{
fun2();
}

Is This Answer Correct ?    10 Yes 11 No

Post New Answer

More C Interview Questions

how many keywords are available in 'c' language a) 32 b) 34 c) 45 d) 48

1 Answers  


Dont ansi function prototypes render lint obsolete?

0 Answers  


What is sizeof int in c?

0 Answers  


What is the importance of c in your views?

0 Answers  


write a program for fibonaci series by using while loop in c?

2 Answers  


What is pointer to pointer in c language?

0 Answers  


Why doesnt the call scanf work?

0 Answers  


What is the use of ?: Operator?

0 Answers  


Explain what does the format %10.2 mean when included in a printf statement?

0 Answers  


how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions

0 Answers  


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

0 Answers  


Can the size of an array be declared at runtime?

0 Answers  


Categories