21.
What will be the output for following code?
#include <stdio.h> 
#include <string.h> 
#include <iostream.h>
using namespace std;
void swap(char *x, char *y) 
{ 
	char temp; 
	temp = *x; 
	*x = *y; 
	*y = temp; 
} 
 
void func(char *a, int l, int r) 
{ 
int i; 
if (l == r) 
	cout<<a<<” ,”; 
else
{ 
	for (i = l; i <= r; i++) 
	{ 
		swap((a+l), (a+i)); 
		func(a, l+1, r); 
		swap((a+l), (a+i)); 
	} 
} 
} 
 
int main() 
{ 
	char str[] = "AB"; 
	int n = strlen(str); 
	func(str, 0, n-1); 
	return 0; 
}

27.
What is the output of the following code?
int fibo(int n)
{ 
      if(n == 1)
        return 0;
      else if(n == 2)
        return 1;
      return fibo(n - 1) + fibo(n - 2);
}
int main()
{
     int n = 10;
     int ans = fibo(n);
     printf("%d",ans);
     return 0;
}