Saved Bookmarks
| 1. |
A=7; B=8; X=a++-b; Printf("%d", X ); What Does This Code Give As Output? |
|
Answer» The COMPILER understands the statement expression a--B by taking off as much OPERATORS as it makes sense to a variable. So (a++) is TAKEN as a parameter and then the expression becomes 8-8 which in turn gives the x value as 0. Thus the OUTPUT value is 0. The compiler understands the statement expression a--b by taking off as much operators as it makes sense to a variable. So (a++) is taken as a parameter and then the expression becomes 8-8 which in turn gives the x value as 0. Thus the output value is 0. |
|