On compiling given program in GCC Compiler :
int main()
{
int a=2,b=3;
(a>1)?b=10:b=50;
printf("%d",b);
return 0;
}
it is showing error that "lvalue required as left operand"
but if i write 4th line as
(a>1)?b=10:(b=50);
Then its showing no compilation error . Can any one explain me why ?
And also how does it differ from if...else... ?