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()
總結
以上是生活随笔為你收集整理的c语言程序最简单例子,简单C语言程序的例子的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Eplan软件盗版
- 下一篇: 使用gcc编写c语言程序,利用GCC工具