/*Program to print all the numbers between a lower bound and a upper bound values*/
#include<stdio.h>
#include<stdlib.h>
void recur(int a, int b);
int main(void)
{
int x,y;
printf("Enter the lower and upper bound values: \n");
scanf("%d %d",&x,&y);
void recur(x,y);
return 0;
}
void recur(int a,int b)
{
if(a<b)
{
printf("%d /n",a);
a++;
void recur(a,b);
}
}
我得到的输出是:
Enter the lower and upper bound values:
10
50
process returned 0.
语法或返回类型有什么问题吗? 我刚刚开始学习 c.需要帮助
最佳答案
两者
void recur(x,y);
void recur(a,b);
声明函数(原型(prototype))。要调用它们,请将它们更改为
recur(x,y);
recur(a,b);
关于C 递归函数调用概念,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31366105/