advertisement
var adpushup = window.adpushup || {};
adpushup.que = adpushup.que || [];
adpushup.que.push(function () {
if (adpushup.config.platform === "MOBILE") {
adpushup.triggerAd("90f55663-effd-4105-b1e7-29d86b526544");
} else if ((window.outerWidth <= 768) || (window.outerWidth == 0)) {
adpushup.triggerAd("90f55663-effd-4105-b1e7-29d86b526544");
}
});
#include <stdio.h>
#include <string.h>
#include<iostream>
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;
}
a) AB,BA,
b) BA,AB,
c) AB,BA
d) BA,AB,
What will be the output for following code?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What will be the output for following code?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!