when i am executing this program:
#include<iostream>
using namespace std;
int main(){
int x=5,y=9;
if(++x=y++){
cout<<"Works "<<x;
}
else{
cout<<"No";
}
return 0;
}
it works fine and the output is: Works 9
but if i execute:
#include<iostream>
using namespace std;
int main(){
int x=5,y=9;
if(x++=y++){
cout<<"Works "<<x;
}
else{
cout<<"No";
}
return 0;
}
it states: In function 'int main()': 6:11: error: lvalue required as left operand of assignment if(x++=y++){