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; }
- 9375 Views
- 1 Answers
1 Answers
-
-
- 22 Jul
- 0 Comment
-
- Reallocation of pointers in C++
- Which is the best software for C++ programming?
- Online test for C plus plus language
- Is Python better than C++? Explain your answer
- Which software is used for C and C++?
- Can someone please update me with the important exam dates of C Plus Plus Programming Exam?
- Most suitable way for returning the logical errors
- Where to find internship for C plus plus ?
- What are the basic concepts of oops in C++?
- Accessing private and protected members
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.