void count_down_from(int num)
{
if (num >= 0) //need the >= operator to go down to zero not just 1
{
printf("%d\n", num);
--num;
count_down_from(num); //you need to send num to the call otherwise it won't be a recursive function
}
else
return;
}
take a look at my modifications
void count_down_from(int num)
{
if (num >= 0) //need the >= operator to go down to zero not just 1
{
printf("%d\n", num);
--num;
count_down_from(num); //you need to send num to the call otherwise it won't be a recursive function
}
else
return;
}
看看我的修改
take a look at my modifications