Datei: p3-5.c


    1   /*
    2    *      p3-5.c
    3    *      Beispielprogramm 5, Abschnitt 3
    4    *      Umwandlung von Fahrenheit in Celsius 
    5    *      fuer f = 0, 20, ..., 300
    6    *      Wie Beispiel 4 aber mit Konstanten
    7    */
    8   
    9   #define LOWER 0         /* untere Grenze der Tabelle */
   10   #define UPPER 300       /* obere Grenze der Tabelle */
   11   #define STEP 20         /* Schrittweite */
   12   
   13   void main(void)
   14   {
   15     int fahr;
   16     
   17     for (fahr=LOWER; fahr<=UPPER; fahr=fahr+STEP)
   18       printf ("%4.0d %6.1f\n", fahr, (5.0/9.0)*(fahr-32));
   19   
   20   } /* main() */


Erzeugt von c2html 1.01