hi again. i have a question on how to get my program to work. my program is to see how many steps a robot can take to get to a certain distance. the user inputs 3 step sizes and the distance. then, my program states how many possible ways the robot can travel the distance. for example, distance is 7. step sizes are 2,3,5. there are 5 possible ways to cover the distance (2+2+3,2+3+2,3+2+2,2+5,5+2).
now my question is how can i fix my recursive functions to work. how can i get the values of the step sizes into the recursive function. here is the code...
int steps(int dist);
printf("Input small step: ");
printf("Input medium step: ");
printf("Input large step: ");
printf("\nIllegal input! Please enter value again!\n\n");
printf("Input total distance to travel: ");
printf("\nNumber of ways the robot can make the trip: %d\n", steps(d));
int steps(int dist)
if(dist <= 2)
return steps(dist-a) + steps(dist-b) + steps(dist-c);