Your void main is a system-specific way of writing the startup function which may or may not work. The C language requires (hosted) implementations to support int main(void) and int main(int, char **). Also, the printf function must be declared before being used. This is because it is variadic. Implicit declarations are not required to be compatible with variadic functions, so this may or may not work. If you fix these problems, then the program outputs 2 (in a reliable way that should work everywhere). The expression x=2 yields the new value of x. The printf function operates on the value produced by the argument expression, not on the object x. (I.e. the new value of x is stable before the function is called, due to a sequence point that happens before a function call, but that is irrelevant since printf does not know anything about x.)