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 (2265)
 C++ interview questions  C++ Interview Questions (1119)
 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
 
which one of follwoing will read a character from keyboard and store in c a)c=getc() b)c=getchar() c)c=getchar(stdin) d)getc(&c) e)none Trident 7
i have a written test in tomorrow Value-Labs 1
how to get starting address of a running C program   3
write a program whose output will be- 1 12 123 1234   6
write a C code To reverse a linked list Motorola 2
program in c to print 1 to 100 without using loop Wipro 9
if we take a number as a char then can we manipulate(add, subtract) on this number   2
What kind of sorting is this? SORT (k,n) 1.[Loop on I Index] repeat thru step2 for i=1,2,........n-1 2.[For each pass,get small value] min=i; repeat for j=i+1 to N do { if K[j]<k[min] min=j; } temp=K[i];K[i]=K[min];K[min]=temp; 3.[Sorted Values will be returned] A)Bubble Sort B)Quick Sort C)Selection Sort D)Merge Sort Accenture 3
what is pointer ? Kernex-Micro-Systems 10
What is the output for the following program #include<stdio.h> main() { char a[5][5],flag; a[0][0]='A'; flag=((a==*a)&&(*a==a[0])); printf("%d\n",flag); } ADITI 5
sir, i cannot find the way how to write aprogram by using array on queue IISIT 1
if a five digit number is input through the keyboard, write a program to calculate the sum of its digits. (hint:-use the modulus operator.'%')   21
 
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