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

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

例子:

1-15-png_6_0_0_135_135_12_13_892.979_1262.879-15-0-1292-15.jpg

#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; }

[上述程序的输出结果如下:

1-15-png_6_0_0_135_533_12_13_892.979_1262.879-15-0-1624-15.jpg

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);

}

[

1-15-png_6_0_0_135_1072_12_12_892.979_1262.879-15-0-2104-15.jpg

其显示的结果为: Factorial value is 2.]

比较两个数较大的那个:

#include

main()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值