Quote:
Why this code works in visual studio 2017 even when I used return statement with digit something different than zero?
the return value is your program telling the caller if anything was correct or not.
When you run a program in a batch command file, it is the mean your program use to tell the batch file there was a problem or not.
This allow the batch file to make decision depending on that return value.