
BASIC OUTPUT AND INPUT STATEMENTS
Output Statements
The common output statements use the fprintf() function. This allows
printing of one or more variables in a string. This can be expressed as:
fprintf (<format string>, <variable>)
The format string is any string or character, variable, equation result, or other
information. Printing the value of a variable can be done by placing the data type
format followed by the variable name within the format string:
fprintf(‘The temperature of the room is %5.3f.\n’, temp)
The use of the format specifier is similar to that of C. In the example, the format
specifier, in this case is
%5.3f, and can be expressed ...