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
- Scope Resolution Operator Versus this pointer in C++?
- Difference between Increment and Decrement Operators
- Problem in comparing Floating point numbers and how to compare them correctly?
- exit(0) vs exit(1) in C/C++ with Examples
- Predefined Macros in C with Examples
- How to create GUI in C programming using GTK Toolkit
- ctype.h(<cctype>) library in C/C++ with Examples
- Slack Bytes in Structures : Explained with Example
- Difference between Iterators and Pointers in C/C++ with Examples
- C program to count number of vowels and consonants in a String
- Nested Loops in C with Examples
- Hello World Program : First program while learning Programming
- Difference between Argument and Parameter in C/C++ with Examples