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.
- calloc() versus malloc()
- typedef versus #define in C
- Scope Resolution Operator Versus this pointer in C++?
- asctime() and asctime_s() functions in C with Examples
- time.h header file in C with Examples
- __builtin_inf() functions of GCC compiler
- Count substrings that contain all vowels | SET 2
- How can we use Comma operator in place of curly braces?
- Basic Code Optimizations in C
- Constants vs Variables in C language
- Sum of an array using MPI
- Difference between pointer to an array and array of pointers
- dot (.) operator in C/C++
- Features and Use of Pointers in C/C++