Question: Is there any example for which the following two loops will not work same way?
If the body-statements contains continue, then the two programs will work in different ways
See the below examples: Program 1 will print “loop” 3 times but Program 2 will go in an infinite loop.
Example for program 1
Example for program 2
Please write comments if you want to add more solutions for the above question.
- typedef versus #define in C
- calloc() versus malloc()
- Scope Resolution Operator Versus this pointer in C++?
- How to Read and Print an Integer value in C
- Nested switch case
- Inline function in C
- Find the Nth term of the series 14, 28, 20, 40,.....
- Loader in C/C++
- Sum of array Elements without using loops and recursion
- Program to Convert Hexadecimal to Octal
- Is there any equivalent to typedef of C/C++ in Java ?
- Find amount to be added to achieve target ratio in a given mixture
- Program to Print Mirrored Hollow Parallelogram
- “static const” vs “#define” vs “enum”