
6 Programming for Chemical Engineers
information, and if not replaced will cause erroneous output, which is
difficult to debug or trace.
BASIC OUTPUT AND INPUT STATEMENTS
Output Statements
The most common output statement used is the printf() function with the
format:
printf(<format string>,<variable>..);
This function prints any variable, equation result, word string, or other
information on the screen. The format string is any string of words that are
enclosed by a double quotation (“
similar to this”). Printing the value of a
variable can be accomplished by placing the format symbol within the quoted
string, followed ...