当前位置:网站首页>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.
边栏推荐
- 【指针】查找最大的字符串
- 《统计学》第八版贾俊平第七章知识点总结及课后习题答案
- Why can swing implement a form program by inheriting the JFrame class?
- 【指针】数组逆序重新存放后并输出
- 【指针】求解最后留下的人
- [pointer] find the length of the string
- [pointer] find the value of the largest element in the two-dimensional array
- Fire! One day transferred to go engineer, not fire handstand sing Conquest (in serial)
- 内网渗透之内网信息收集(三)
- Transplant hummingbird e203 core to Da Vinci pro35t [Jichuang xinlai risc-v Cup] (I)
猜你喜欢
Don't you even look at such a detailed and comprehensive written software test question?
Statistics 8th Edition Jia Junping Chapter 4 Summary and after class exercise answers
Realize applet payment function with applet cloud development (including source code)
Statistics, 8th Edition, Jia Junping, Chapter 6 Summary of knowledge points of statistics and sampling distribution and answers to exercises after class
Keil5-MDK的格式化代码工具及添加快捷方式
“Hello IC World”
Based on authorized access, cross host, and permission allocation under sqlserver
数字电路基础(五)算术运算电路
Chain team implementation (C language)
Four methods of exchanging the values of a and B
随机推荐
数据库多表链接的查询方式
JDBC read this article is enough
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
Why can swing implement a form program by inheriting the JFrame class?
ByteDance ten years of experience, old bird, took more than half a year to sort out the software test interview questions
Realize applet payment function with applet cloud development (including source code)
函数:计算字符串中大写字母的个数
Statistics 8th Edition Jia Junping Chapter 1 after class exercises and answers summary
Binary search tree concept
XSS (cross site scripting attack) for security interview
Circular queue (C language)
浙大版《C语言程序设计实验与习题指导(第3版)》题目集
About the garbled code problem of superstar script
《统计学》第八版贾俊平第二章课后习题及答案总结
指針:最大值、最小值和平均值
Statistics 8th Edition Jia Junping Chapter 3 after class exercises and answer summary
Fire! One day transferred to go engineer, not fire handstand sing Conquest (in serial)
函数:用牛顿迭代法求方程的根
Statistics, 8th Edition, Jia Junping, Chapter VIII, summary of knowledge points of hypothesis test and answers to exercises after class
【指针】求字符串的长度