Last active
March 2, 2023 18:52
-
-
Save m-naeem66622/ce4d6116fe675406182070e5ea6deb24 to your computer and use it in GitHub Desktop.
Weird things about increment or decrement operators with equality operator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
for (int i=0; i < 4; i++) | |
{ | |
cout<<i<<" iteration \n"; | |
if(cout<<"before condition "<<i<<"\n" && i == i++ && cout<<"after condition "<<i<<"\n") | |
{ | |
cout << i<< "\n"; | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment