Friday, January 6, 2012

What is displayed if the precision specified for a real is less than or greater than the actual or not specified?

-Less than actual, the printf function displays only the number of digits in the specified precision (trailing digits are not lost from memory, they simply are not displayed)

-Greater than actual, the printf function adds trailing zeros to make the displayed precision equal to the precision specified.

-Not specified, the printf function makes the precision equal to six (it adds trailing zeros or truncates digits if necessary to get a precision of six; these actions do not change the value stored in memory.)

No comments:

Post a Comment