Page t005, go to NEXT, PREVIOUS, INDEX

Input and Output


Introduce I/O early, so we can run programs and see something happen :-)

Example

      #include <stdio.h>

      /* Read and print three floating point numbers */

      int main()
      {
        float a, b, c;

        /* Input */
        scanf ("%f %f %f", &a, &b, &c);

        /* Output */
        printf ("%f, %f, %f\n", a, b, c);

        return (0);
      }

C Course, 15-jan-1997, Peter Klok, pfk@hef.kun.nl