这是一些有关于简单程序的例子
例子:
#include
main () {
tips(); /*caller*/ printf(“\n Success is about banging on after others have let go”); }
tips() /*caller*/
{ printf (“\n When you reach the end of the rope tie a knot & hang on”,)0; }
[上述程序的输出结果如下:
When you reach the end of the ropt tie a knot & hang on.
Success is about hanging on after others have let go.]
#include main()
{
int a,fact; printf(“\nEnter any number”); scanf(“%d”,&a);
fact=rec(a);
printf(“Factorial value is%d”,fact);
} rec(x); int x; { int f; if(x==1) return(1);
else f=x*rec(x-1);
return(f);
}
[
其显示的结果为: Factorial value is 2.]
比较两个数较大的那个:
#include
main()