700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > c语言程序最简单例子 简单C语言程序的例子

c语言程序最简单例子 简单C语言程序的例子

时间:2021-03-12 22:41:59

相关推荐

c语言程序最简单例子 简单C语言程序的例子

这是一些有关于简单程序的例子

例子:

#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()

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。