Sunday, February 14, 2010

19

#include< stdio.h >
main( )
{
int a=1,b=2;
(a+b)++;
printf("%d %d",a,b);
}


Output:


compilation error:
Lvalue required.


Logic:


we can increment the value of variables not constant. In this program (a+b)++ is given. (3)++ is not valid. We can't store values in constant. i.e., 3=3+1 is wrong. In left side we should use variable not a constant. So it shows "Lvalue require."

0 comments:

Post a Comment