Home / MCQ Bank / Computer
Computer Miscellaneous On Data Structures Difficulty: Medium

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; }

Select the correct option to test your answer:

More Computer Questions

Insert Date, Format Page Number, and Insert AutoText are buttons on the ________ toolbar. How do you create a proc in Ruby? What will be the output of the following Java program? import java.util.*; class Linkedlist { public static void main(String args[]) { LinkedList obj = new LinkedList(); obj.add("A"); obj.add("B"); obj.add("C"); obj.removeFirst(); System.out.println(obj); } } A node is said to be . . . . . . . . if it has a possibility of reaching a complete solution. RAM can be treated as the____________for the computer's processor?