Output of the program:
#include int main() { int size; printf(\"Enter the size of array: \"); scanf(\"%d\",&size); i
By reading and writing past the array, your program invokes undefined behavior. It doesn't mean that it has to crash or print garbage values, it can pretend working fine. Apparently, that's what is happening in this case.