The doo() function first uses scanf() to ensure that all of the data in the dynamic array is numeric, find the minimum and maximum, calculate the average, and sample standard deviation. scanf() writes all of the information it has collected and/or calculated to the file, including an error message if any nonnumeric data was encountered.