The output of the printf("%d") is the last entered value enterd through keyboard for any of the C programs as a input, suppose if you enter 50 as input to the any C program and it is the last input, then after executing the printf("%d") you will get 50, anyway 50 is garbage value, but it will prints the last number enterd through keyboard. Check it on Turbo C (I am not sure in VC++)
Above answer was rated as good by the following members: akshaygs21
The output of the printf("%d") is the last entered value enterd through keyboard for any of the C programs as a input, suppose if you enter 50 as input to the any C program and it is the last input, then after executing the printf("%d") you will get 50, anyway 50 is garbage value, but it will prints the last number enterd through keyboard. Check it on Turbo C (I am not sure in VC++)