For the following c++ program :
#include<iostream>
using namespace std;
int main()
{
int i=1;
while(i<=10)
{
if(i==5)
continue;
cout<<endl<<i;
i++;
}
return 0;
}
The outputs given by codeblock and online compilers vis. https://www.programiz.com/cpp-programming/online-compiler/ and https://www.onlinegdb.com/online_c++_compiler is different.
The output given by the codeblocks :
1
2
3
4
The outputs by the online compilers :
1
2
3
According to me the output given by the codeblock should be correct . Hence, I am unable to understand why the two online compilers are not giving 4 as an output. Is it because of the while loop running infinite times ?