循环结构作业c语言,C语言循环结构练习题带答案(最新整理)
《C語(yǔ)言循環(huán)結(jié)構(gòu)練習(xí)題帶答案(最新整理)》由會(huì)員分享,可在線閱讀,更多相關(guān)《C語(yǔ)言循環(huán)結(jié)構(gòu)練習(xí)題帶答案(最新整理)(10頁(yè)珍藏版)》請(qǐng)?jiān)谌巳宋膸?kù)網(wǎng)上搜索。
1、第 5 章循環(huán)結(jié)構(gòu)程序設(shè)計(jì)練習(xí)題1. 單項(xiàng)選擇題(1) 語(yǔ)句 while (!e);中的條件!e 等價(jià)于A。A. e=0B. e!=1C. e!=0D. e(2) 下面有關(guān) for 循環(huán)的正確描述是D。A. for 循環(huán)只能用于循環(huán)次數(shù)已經(jīng)確定的情況B. for 循環(huán)是先執(zhí)行循環(huán)體語(yǔ)句,后判定表達(dá)式C. 在 for 循環(huán)中,不能用 break 語(yǔ)句跳出循環(huán)體D. for 循環(huán)體語(yǔ)句中,可以包含多條語(yǔ)句,但要用花括號(hào)括起來(lái)(3)C 語(yǔ)言中D。A. 不能使用 do-while 語(yǔ)句構(gòu)成的循環(huán)B. do-while 語(yǔ)句構(gòu)成的循環(huán)必須用 break 語(yǔ)句才能退出C. do-while 語(yǔ)句構(gòu)成的循環(huán)。
2、,當(dāng) while 語(yǔ)句中的表達(dá)式值為非零時(shí)結(jié)束循環(huán)D. do-while 語(yǔ)句構(gòu)成的循環(huán),當(dāng) while 語(yǔ)句中的表達(dá)式值為零時(shí)結(jié)束循環(huán)(4)C 語(yǔ)言中 while 和 do-while 循環(huán)的主要區(qū)別是A。A. do-while 的循環(huán)體至少無(wú)條件執(zhí)行一次B. while 的循環(huán)控制條件比 do-while 的循環(huán)控制條件嚴(yán)格C. do-while 允許從外部轉(zhuǎn)到循環(huán)體內(nèi)D. do-while 的循環(huán)體不能是復(fù)合語(yǔ)句(5) 以下程序段C。第 5 章 循環(huán)結(jié)構(gòu)程序設(shè)計(jì)41int x=-1; dox=x*x;while (!x);A. 是死循環(huán)B. 循環(huán)執(zhí)行二次C. 循環(huán)執(zhí)行一次D. 有語(yǔ)法錯(cuò)誤。
3、(6) 下列語(yǔ)句段中不是死循環(huán)的是 C 。A. i=100;while (1)i=i%100+1;if (i=20) break;B. for (i=1;i+)sum=sum+1;C. k=0; do+k; while (k main()int i;for (i=4;i main()int num=0;while (num main()int s=0,k;for (k=7;k=0;k-)switch(k)case 1:case 4:case 7: s+; break; case 2:case 3:case 6: break;case 0:case 5: s+=2; break;cout mai。
4、n()int i=1,s=3; dos+=i+;if (s%7=0)continue; else+i; while (s main()int i,j;for (i=4;i=1;i-)cout main()int i,j,k;for (i=1;i main()int i,j,k;for (i=1;i0;k-) cout main()int i,j,k;for (i=1;i0;i-)for (j=1;j=20-3*i;j+) cout ;for (k=1;k=2*i-1;k+) cout*;coutendl;輸出結(jié)果:*“”“”At the end, Xiao Bian gives you a p。
5、assage. Minand once said, people who learn to learn are very happy people. In every wonderful life, learning is an eternal theme. As a professional clerical and teaching position, I understand the importance of continuous learning, life is diligent, nothing can be gained, only continuous learning ca。
6、n achieve better self. Only by constantly learning and mastering the latest relevant knowledge, can employees from all walks of life keep up with the pace of enterprise development and innovate to meet the needs of the market. This document is also edited by my studio professionals, there may be errors in the document, if there are errors, please correct, thank you。
總結(jié)
以上是生活随笔為你收集整理的循环结构作业c语言,C语言循环结构练习题带答案(最新整理)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: linux+android4.2键值关系
- 下一篇: c语言编译 64位,cmake – 编译