Home / MCQ Bank / Computer
Computer Programming Basics Difficulty: Medium

Locator function gives output as . . . . . . . .

Select the correct option to test your answer:

More Computer Questions

What does the += operator do when used with events in C#? Which of these methods is used to know whether a string contains "true"? What will be the output for the following code? #include <stdio.h> #include <stdlib.h> void combination(int arr[], int aux[], int start, int end, int index, int r); int compare (const void * a, const void * b) { return ( *(int*)a - *(int*)b ); } void print(int arr[], int n, int r) { int aux[r]; qsort (arr, n, sizeof(int), compare); combination(arr, aux, 0, n-1, 0, r); } void combination(int arr[], int aux[], int start, int end, int index, int r) { if (index == r) { for (int i=0; i<r; i++) printf("%d " ,aux[i]); printf(", "); return; } for (int i=start; i<=end && end-i+1 >= r-index; i++) { aux[index] = arr[i]; combination(arr, aux, i+1, end, index+1, r); while (arr[i] == arr[i+1]) i++; } } int main() { int arr[] = {1, 2, 2}; int r = 2; int n = sizeof(arr)/sizeof(arr[0]); print(arr, n, r); } What does the lambda? method do in Ruby? Which type of graph has no odd cycle in it?