What Will Be The Output For The Following Codep Pre Langc #1161

What will be the output for the following code?</p> <pre><code class="language-c"> #include <stdio.h> void combination(int arr[], int aux[], int start, int end, int index, int r); void print(int arr[], int n, int r) { int aux[r]; 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 j=0; j<r; j++) printf("%d ", aux[j]); 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); } } int main() { int arr[] = {1, 2, 3}; int r = 2; int n = sizeof(arr)/sizeof(arr[0]); print(arr, n, r); } </code></pre>

Online Quiz This multiple choice question (MCQ) is related to the book/course gs gs122 Data Communication and Computer Network. It can also be found in gs gs122 Number Theory - Generating Combinations - Quiz No.1.


Similar question(s) are as followings:



Online Quizzes of gs122 Data Communication and Computer Network

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background