ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Programming Languages >> C
 
 


 

 
 C interview questions  C Interview Questions (2262)
 C++ interview questions  C++ Interview Questions (1118)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (648)
Question
What is indirect recursion? give an example?
 Question Submitted By :: C
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
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 ?    26 Yes 7 No
Hussain
 
Answer
# 2
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 ?    18 Yes 4 No
Vishwanath Pillay
 
 
 
Answer
# 3
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 ?    1 Yes 0 No
Deepak Verma
 
Answer
# 4
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 ?    3 Yes 5 No
J J Ramesh / Ap / Mca / Jjcet
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
How can we allocate array or structure bigger than 64kb? CSC 2
helllo sir , what is the main use of the pointer ,array ,and the structure with the example of a programe   2
int main() { int *p=new int; *p=10; del p; cout<<*p; *p= 60; cout<<*p; } what will be the output & why? TCS 4
There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables. Google 14
Write a program to enter the name and age. If age>28 then find salary categories. if age<28 then find that you are gaduate or not.   1
Write a C program where input is: "My name is xyz". output is: "xyz is name My". TCS 1
we have a 3litres jug and a 5 litres jug and no measures on them. using these two jugs how can we measure 4 litres of water? Convergys 1
what is foreign key in c language? ADP 1
how to convert binary to decimal and decimal to binary in C lanaguage BPO 7
program to print circle structure   1
CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION.   15
O,T,T,F,F,S,S,E,N,?,?,?,T,F,F,S,S,E,N ADP 9
 
For more C Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com