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 (2253)
 C++ interview questions  C++ Interview Questions (1111)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (646)
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
 
write a program for even numbers? TCS 19
what is function pointer? Wipro 2
What will be the output of the following program #include<stdio.h> void main() { int i=20; i-=i+++++i++; printf("%d",i); }   4
how many header file is in C language ? CTS 42
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this   1
How can I invoke another program from within a C program?   8
A B C D E F G F E D C B A A B C D E F F E D C B A A B C D E E D C B A A B C D D C B A A B C C B A A B B A A A   2
hello everybody can we change a the adress of a variabl i mean can i put for exemple for a int *p: &p=6 ?????????   1
What is the difference b/w Structure & Class?   3
Program to trim a given character from a string. NetApp 4
how to connect oracle in C/C++. TCS 3
what is difference between ANSI structure and C99 Structure? Wipro 1
 
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