How many times will this loop execute?
How many times will this loop execute? Explain your answer. unsigned char half_limit = 150; for (unsigned char i = 0; i < 2 * half_limit; ++i) { // do something; }
- 9379 Views
- 1 Answers
1 Answers
-
-
- 22 Jul
- 0 Comment
-
- Is Python better than C++? Explain your answer
- When we already have C language then why C++?
- how c plus plus is different than java ?
- What is difference between C and C++ ?
- Interview questions for C++ language
- What are the five basic elements of a C++ program?
- What are the topics in C++? Explain your answer
- Which software is used for C and C++?
- Difference between class and struct?
- Which is the best software for C++ programming?
Practice Mock Test
c plus plus programming
this code will result in an infinite loop. However since i is an unsigned char, it is represented by an 8-bit value which, after reaching 255, will overflow (so it will go back to 0) and the loop will, therefore, go on forever.