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++?
- Why to use fgets() over scanf() in C?
- Thread functions in C/C++
- How to Compile and Run C/C++/Java Programs in Linux
- How to get the current position of cursor from output screen in C?
- Methods to concatenate string in C/C++ with Examples
- Compiling with g++
- Why learning C Programming is a must?
- Lex program to count the number of lines, spaces and tabs
- C program to check if a given string is Keyword or not
- Difference between scanf() and gets() in C
- Dividing a Large file into Separate Modules in C/C++, Java and Python