The correct Output would be 1 2 1 . ++i returns the incremented value ... whereas i++ prints the pre incremented value.