Unfortunately, for a program of any substantial complexity, it is rare that we can be fully confident it is entirely correct. Highly complex programs commonly undergo continued testing, revision and correction even while they are in common use. This is the process called maintaining a program.
Most of the programs you will write in this course can be thoroughly validated by a combination of processes. First, as you become familiar in using C++, you will begin to discover sources of error by inspection. When you have finished writing a program , do not assume it is correct, Read it through again carefully and never assume that you have solved all of the difficulties the first time. The second technique, and one you will find helpful, is called tracing. Tracing is the process of outputting values of certain variables at critical points in the execution of the program. These statements can be removed whenever they no longer serve a useful purpose.