What Is The Output Of The Following Programp Pre Langc #1981
What is the output of the following program?</p> <pre><code class="language-c"> #include<stdio.h> int main() { int coins[10]={1,3,4},lookup[100]; int i,j,tmp,num_coins = 3,sum=14; lookup[0]=0; for(i=1;i<=sum;i++) { int min_coins = i; for(j=0;j<num_coins;j++) { tmp=i-coins[j]; if(tmp<0) continue; if(lookup[tmp] < min_coins) min_coins=lookup[tmp]; } lookup[i] = min_coins + 1; } printf("%d",lookup[sum]); return 0; }</code></pre>
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 Dynamic Programming - Coin Change Problem - Quiz No.1.
Similar question(s) are as followings:
Online Quizzes of gs122 Data Communication and Computer Network
Sorting - Insertion Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - Insertion Sort - Quiz No.2
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - Insertion Sort - Quiz No.3
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - LSD Radix Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - MSD Radix Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - MSD Radix Sort - Quiz No.2
gs gs122 Data Communication and Computer Network
Online Quizzes