can you give smallest, complete compilable code that will reproduce the code please?

please explain how the results are different.