Example Programs Errata -------------------------------------------------------------------------------- Section 01 / Program 8: A few syntax errors are present in this program. You will have to correct the program during lab #2. -------------------------------------------------------------------------------- Section 02 / Program 4: Program is inconsistent with the output. A better program would be: #include #include int main (void) { int n1, n2; printf ("The rand function returns a randomly chosen integer between 0 and 32767.\n"); n1 = rand(); printf ("This is a randomly chosen integer: %d\n", n1); n2 = -n1; printf ("This is the negative value of that integer: %d\n", n2); /* the abs function (for integers)*/ printf ("This is the absolute value of that integer: %d\n", abs(n2)); return (0); } -------------------------------------------------------------------------------- Section 02 / Program 7: The #include is missing. -------------------------------------------------------------------------------- Section 07 / Program 6: Correct the following printfs: printf ("\nThe array contains %d values "); printf ("for a capacity of 100 cells.\n", actual_size); should be printf ("\nThe array contains %d values ",actual_size); printf ("for a capacity of 100 cells.\n"); --------------------------------------------------------------------------------