for (int b = 1; b <= Kth_integer; ++b) {
ifile >> inums[b];
}
Once a program is invalid, the rest of the program is also invalid. You access an element which is not inside the array. The fact that all programs with such errors do not automatically fail is what makes debugging so interesting at times.
At this point, you can't know what will happen - sometimes it works (or more likely seems to for a while at least), other times it does something completely different.
In fact, you may get gpp to fail if you compile with -O say (the optimiser). This rearranges the code/data, and this may expose the problem. Then again it might not.
This is a sure sign that you have a problem. A correct program should produce the same answer with a correct compiler.
Certainly any program which sticks to ANSI only features, when compiled with an ANSI compliant compiler (or one which claims to be). Even then, there can be the occasional obscurity to trip you up.
> She uses turbo
This isn't an ANSI compliant compiler, so you're already on a slightly slippy slope.