What Will Be The Output Of The Following Codep Pre Langc #1171

What will be the output of the following code?</p> <pre><code class="language-c"> #include<iostream> using namespace std; int list[200]; void func(int n, int m = 0) { int i; if(n == 0) { for(i = 0; i < m; ++i) printf("%d ", list[i]); printf("\n"); return; } for(i = n; i > 0; --i) { if(m == 0 || i <= list[m - 1]) { list[m] = i; func(n - i, m + 1); } } } int main() { int n=3; func(n,0); return 0; }</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 Partitions - 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