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++?
- Difference between C and C#
- scanf("%[^\n]s", str) Vs gets(str) in C with Examples
- time.h localtime() function in C with Examples
- Conditional or Ternary Operator (?:) in C/C++
- C program to Insert an element in an Array
- Types of Literals in C/C++ with Examples
- 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?