在屏幕上顯示HelloWorld.pptVIP

  • 12
  • 0
  • 约1.44万字
  • 约 41页
  • 2017-04-10 发布于上海
  • 举报
在屏幕上顯示HelloWorld

§2.1 在屏幕上显示Hello World 第2章 用C语言编写程序 用算例尽快进入编程 例2-1 在屏幕上显示一个短句: Hello World /* 显示“Hello World!” */ #include stdio.h void main( ) { printf(Hello World! \n); } 主函数 注释文本 调用输出函数 预编译 程序中涉及语法点: printf由库函数stdio.h解释 其参数:字符串,显示字符串 \n 换行符 函数后的“;”表示函数语句 要求在屏幕上显示文字: printf(要显示的文字); 学习方法:阅读、模仿、改写-编写 例2-2 在屏幕上显示: Programming is fun! And Programming in C is even more fun! #include stdio.h void main( ) { printf(Programming is fun! \n); printf(And Programming in C is even more fun! \n); } 根据要求在屏幕上显示文字: printf(要显示的文字); 注:换行符\n的使用 源程序: §2.2 求华氏温度100°

文档评论(0)

1亿VIP精品文档

相关文档