当前位置:网站首页>C language do while loop classic Level 2 questions
C language do while loop classic Level 2 questions
2022-07-06 14:48:00 【Drunk salted fish peddler】
A classic second level problem , The error rate is relatively high :
ask : At the end of the program b The value of is :
int a = 1,b = 10;
do
{
b -= a;
a++;
}while(b-- <0)
A. 9
B. -2
C.-1
D. 8
First do while No matter the condition is 0 Still for 1 Will cycle at least once , And this question is b > 0, So the condition is zero ( The condition is false ), So only cycle once , Go through the cycle b The value is 9,but, After the cycle, there is another b--,b Self reduction 1 No implementation ,9 Self subtraction 1 obtain 8.

边栏推荐
- Proceedingjoinpoint API use
- Database monitoring SQL execution
- High concurrency programming series: 6 steps of JVM performance tuning and detailed explanation of key tuning parameters
- Wu Enda's latest interview! Data centric reasons
- Statistics, 8th Edition, Jia Junping, Chapter VIII, summary of knowledge points of hypothesis test and answers to exercises after class
- 《统计学》第八版贾俊平第四章总结及课后习题答案
- 指针:最大值、最小值和平均值
- 后台登录系统,JDBC连接数据库,做小案例练习
- Pointeurs: maximum, minimum et moyenne
- Intranet information collection of Intranet penetration (3)
猜你喜欢
![Harmonyos application development -- address book management system telmanagesys based on listcontainer [phonebook][api v6]](/img/0b/ddbee0b8a34627e13bff5598bbaed8.jpg)
Harmonyos application development -- address book management system telmanagesys based on listcontainer [phonebook][api v6]

“Hello IC World”

About the garbled code problem of superstar script

数字电路基础(五)算术运算电路

Interview Essentials: what is the mysterious framework asking?

Want to learn how to get started and learn software testing? I'll give you a good chat today

Get started with Matplotlib drawing

1.支付系统

. Net6: develop modern 3D industrial software based on WPF (2)

Statistics 8th Edition Jia Junping Chapter 5 probability and probability distribution
随机推荐
Fundamentals of digital circuits (II) logic algebra
Wu Enda's latest interview! Data centric reasons
使用 flask_whooshalchemyplus jieba实现flask的全局搜索
Statistics 8th Edition Jia Junping Chapter IX summary of knowledge points of classified data analysis and answers to exercises after class
Wang Shuang's detailed learning notes of assembly language II: registers
《统计学》第八版贾俊平第十四章指数知识点总结及课后习题答案
《统计学》第八版贾俊平第二章课后习题及答案总结
《统计学》第八版贾俊平第六章统计量及抽样分布知识点总结及课后习题答案
Flash implements forced login
What level do 18K test engineers want? Take a look at the interview experience of a 26 year old test engineer
“Hello IC World”
Statistics 8th Edition Jia Junping Chapter 14 summary of index knowledge points and answers to exercises after class
What is an index in MySQL? What kinds of indexes are commonly used? Under what circumstances will the index fail?
后台登录系统,JDBC连接数据库,做小案例练习
Quaternion -- basic concepts (Reprint)
JVM memory model concept
Résumé des points de connaissance et des réponses aux exercices après la classe du chapitre 7 de Jia junping dans la huitième édition des statistiques
【指针】数组逆序重新存放后并输出
Numpy快速上手指南
Overview of LNMP architecture and construction of related services