Select the correct option to test your answer:
More Computer Questions
What will be the output of the following C code? #include <stdio.h> int main() { printf("Ram\rShyam\n"); return 0; }
What type of queue implementation would be best for implementing a scheduling algorithm?
What is the purpose of the fromkeys() method for dictionaries?
What is the output of the following code? #include<stdio.h> int get_ways(int num_of_dice, int num_of_faces, int S) { int arr[num_of_dice + 1][S + 1]; int dice, face, sm; for(dice = 0; dice <= num_of_dice; dice++) for(sm = 0; sm <= S; sm++) arr[dice][sm] = 0; for(sm = 1; sm <= S; sm++) arr[1][sm] = 1; for(dice = 2; dice <= num_of_dice; dice++) { for(sm = 1; sm <= S; sm++) { for(face = 1; face <= num_of_faces && face < sm; face++) arr[dice][sm] += arr[dice - 1][sm - face]; } } return arr[num_of_dice][S]; } int main() { int num_of_dice = 4, num_of_faces = 6, sum = 3; int ans = get_ways(num_of_dice, num_of_faces, sum); printf("%d",ans); return 0; }
Which keyword is used to create a new name for an existing data type in C?