Question: C Programming: //-------------------------------------------------- // Problem #24 // Problem24.c //-------------------------------------------------- #include #include #include #define SHOWCLIMB const int LARGEST_STEPSIZE = 2; //-------------------------------------------------- int main() //-------------------------------------------------- { void
C Programming:


![void ClimbNStairs(int climb[],int steps,const int n,int *ways); int n; printf("n? "); while](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f5262e08fd6_12566f5262d6ff7d.jpg)

//--------------------------------------------------
// Problem #24
// Problem24.c
//--------------------------------------------------
#include
#include
#include
#define SHOWCLIMB
const int LARGEST_STEPSIZE = 2;
//--------------------------------------------------
int main()
//--------------------------------------------------
{
void ClimbNStairs(int climb[],int steps,const int n,int *ways);
int n;
printf("n? ");
while ( scanf("%d",&n) != EOF )
{
int *climb = (int *) malloc(sizeof(int)*(n+1));
int ways;
ways = 0;
ClimbNStairs(climb,0,n,&ways);
#ifndef SHOWCLIMB
printf("%10d ways ",ways);
#endif
free(climb);
printf("n? ");
}
system("PAUSE");
return( 0 );
}
//--------------------------------------------------
void ClimbNStairs(int climb[],int steps,const int n,int *ways)
//--------------------------------------------------
{
int LengthOfClimb(const int climb[],const int steps);
if ( LengthOfClimb(climb,steps) == n )
{
(*ways)++;
#ifdef SHOWCLIMB
{
Student provides missing code to display the climb[] using the required format.
}
#endif
}
else
{
int stepSize;
Student provides missing code to consider adding/deleting a 1-stair step to climb,
then adding/deleting a 2-stair step to climb[],..., finally, adding/deleting a
LARGEST_STEPSIZE-stair step to climb[]. You must "sandwich" a recursive call between each
add and delete. Hints Consider the state-space tree that describes the solution space
for this problem. It is only possible to make a stepSize-stair step
when (LengthOfClimb(climb,steps)+stepSize
}
}
//--------------------------------------------------
int LengthOfClimb(const int climb[],const int steps)
//--------------------------------------------------
{
Student provides missing code to compute the quantification
steps
climb[i]
i = 1
}
PLEASE fill in the missing source code in the THREE designated areas in the source file Problem24.c (located below) that says "Student provides missing code..." below. Please also provide a screenshot(s) of the compiled output once complete. I have provided sample ones which should give an idea on how it should look
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
