From Conservapedia
Jump to: navigation, search

Pseudocode is a form of "mock" computer code. Unlike most computer code, it's intended to be understood only by humans, and usually can't be parsed by a compiler or interpreter. Pseudocode is often shorter than the equivalent source code, because it seeks to be more understandable by glossing over less important details. Pseudocode is used for instructional purposes (particularly in introductory courses), for discussing an algorithm in a somewhat language-neutral way, or for building an initial skeleton in a low-level design document.


In C++ code, an "if/else" statement is as follows:
if ( pi < 4 ) {
 cout << "pi is approximately correct";
else if ( pi >= 4 ) {
 cout << "pi is not set correctly";
else {
 cout << "an error has occurred";

The pseudocode may look something like this:
if pi is < 4
 say "pi is approximately correct"
if pi is >= 4
 say "pi is not set correctly"
otherwise say "an error has occurred"