Fill In The Blank To Complete The Codep Pre Langc #1973
Fill in the blank to complete the code.</p> <pre><code class="language-c"> #include<stdio.h> int main() { int coins[10]={1,3,4},lookup[100000]; int i,j,tmp,num_coins = 3,sum=100; 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) ______________; } 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.
Fill in the blank to complete the code.
#include<stdio.h> int main() { int coins[10]={1,3,4},lookup[100000]; int i,j,tmp,num_coins = 3,sum=100; 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) ______________; } lookup[i] = min_coins + 1; } printf("%d",lookup[sum]); return 0; }
lookup[tmp] = min_coins
min_coins = lookup[tmp]
break
continue
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