正在加载图片...
H/ example1.1 calculate the, si a and b*/ include <stdio.h> 预 This is the main program maino 函数 注释 i int a, b, sum a=10 b=24 语句 sum=add(a, by printf(sum≠dn,sum); Thigfunction calculates the sum of x and y * nt add(int x, int y) i int z Z=X+y; return (z) 运行结果 sum=34首页→C语言教学→幻灯片版→第一章 /* example1.1 calculate the sum of a and b*/ #include <stdio.h> /* This is the main program */ main() { int a,b,sum; a=10; b=24; sum=add(a,b); printf(”sum= %d\n" ,sum); } /* This function calculates the sum of x and y */ int add(int x,int y) { int z; z=x+y; return(z); } 运行结果: sum=34 函数 语句 预处理命令 注释 > 例1.2
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有