第六章循环结构C程序设计.pptVIP

  • 23
  • 0
  • 约1.8万字
  • 约 76页
  • 2017-08-18 发布于湖北
  • 举报
第六章 循环结构的C程序设计 第一节 循环的基本概念 第二节 while语句 第三节 do-while语句 第四节 for语句 第五节 break、continue、goto语句 第六节 几种循环语句比较 第七节 循环的嵌套 第八节 程序举例 循环的必要性 int result1,result2,result3; int result4,result5; result1 = 1 * 10; printf(1 × 10 = %d \n,result1); result2 = 2 * 10; printf(2 × 10 = %d \n,result2); result3 = 3 * 10; printf(3 × 10 = %d \n,result3); result4 = 4 * 10; printf(4 × 10 = %d \n,result4); result5 = 5 * 10; printf(5 × 10 = %d \n,result5); 循环的必要性 C 语言中的各种循环 例:分析程序的运行结果 #include stdio.h main ( ) { int i=1,sum=0; while ( i=100 ) printf(“i=%d,sum=%d”,i,sum += i); i++; printf(”Sum=%d\n”,su

文档评论(0)

1亿VIP精品文档

相关文档