C语言程序设计 刘国成 张丹彤 第一章新.pptVIP

  • 3
  • 0
  • 约1.92千字
  • 约 11页
  • 2015-12-14 发布于广东
  • 举报

C语言程序设计 刘国成 张丹彤 第一章新.ppt

  C语言程序设计教程 C语言程序设计基本知识 C语言程序的基本结构 C语言字符集、标识符与关键字 C语言程序的开发环境 C程序格式和结构特点 例 第一个程序 Hello,World! /* example1.1 The first C Program*/ #include stdio.h main() { printf(“Hello,World!”); } 注释 编译预处理 函数 语句 输出: Hello,World! 例 /* 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 函数 语句 预处理命令 注释 结构特点 函数与主函数 程序由一个或多个函数

文档评论(0)

1亿VIP精品文档

相关文档