#include<stdio.h>
int main()
{
int a = 10;
++a = 20;
printf("a = %d", a);
getchar();
return 0;
}
The output obtained for the above code is : a=20; when run as C++ code.
#include<stdio.h>
int main()
{
int a = 10;
a++ = 20;
printf("a = %d", a);
getchar();
return 0;
}
This gives compilation error. What is the reason behind this?