// total and sum3 values must be same after execution of the below two c codes void main() { int a=10; int total; printf("Value of a before ++a is :%d\n",a); ++a; printf("Value of a after ++a is :%d\n",a); total=(((++a)*(10))+((++a)*(10))+((++a)*(10)));/* total and sum3 values must be same after execution of the below two c codes*/ printf("Value of total is :%d\n",total ); int a=10; int sum1,sum2,sum3; printf("Value of a before ++a is :%d\n",a); ++a; printf("Value of a after ++a is :%d\n",a); sum1=((++a)*10); // here total is broken into sum1, sum2, sum3 sum2=(sum1)+((++a)*10); sum3=(sum2)+((++a)*10); printf("Value of sum1 is :%d\n",sum1 ); printf("Value of sum2 is :%d\n",sum2 ); printf("Value of sum3 is :%d\n",sum3 ); printf("Value of ++a at end is :%d\n",a); }
++a
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)