Cognizant GenC Elevate Sample Coding Question 10

Question 10

In this article, we will discuss about Coding Question with their solution in C++ and java. In this Question , Adil is pondering over the number of ways in which he can pay for the movie. He has x1, x2, x3, x4 coins of values 1,2,5 and 10 respectively. He wants to determine the number of ways in which he can pay an amount A.

Question 10

Question 10

After Watching a movie at PVR, Adil is pondering over the number of ways in which he can pay for the movie. He has x1, x2, x3, x4 coins of values 1,2,5 and 10 respectively. He wants to determine the number of ways in which he can pay an amount A.

You need to fill in a function that returns the number of ways to pay total amount

Input Specifications:

Input 1: An integer value denoting the total amount to be paid

Output Specification:
Return an Integer value denoting the number of ways to pay the total amount

Example1:
Input1: 40
Output : 195

Example2:
Input1: 4
Output : 3