267 views
1 votes
1 votes

main ( )
{
int n=4;
move(n,’A’,’B’,’C’);
}
move(n,sp,ap,ep)
int n;
char sp,ap,ep;
{
if (n= =1) 
printf(“move from %C to %C”,sp,ep); 
else
{
move(n-1,sp,ep,ap);
move(1,sp,”,ep);
move(n-1,ap,sp,ep);
}

What will be the 10th line of output of above program?

  1.  Move from C to A
  2.   Move from A to C
  3.   Move from B to C
  4.   Move from B to A

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
2
srestha asked Mar 7, 2018
581 views
#include<stdio.h int fun1(int x) { x=14; } int fun2(int x) { x=20; } int main() { int(*p)(),m,n; scanf("%d",&m); if(m) p=fun1; else p=fun2; n=(*p)(); printf("%d",n); retu...
0 votes
0 votes
0 answers
3
srestha asked Mar 6, 2018
393 views
#include<stdio.h int main() { char a[]={'A','B','C','D'}; char *p=&a[0]; *p++; printf("%c%c",*++p, *p); }What will be the output?1)C B2)B B3)B A4)C A
0 votes
0 votes
0 answers
4
Parshu gate asked Dec 5, 2017
454 views