folge.c
changeset 0 af501b0c1716
child 9 c3fecc82ade6
equal deleted inserted replaced
-1:000000000000 0:af501b0c1716
       
     1 /*
       
     2  *     $Id: folge.c,v 1.1.1.1 2008-04-28 17:32:53 mbroeker Exp $
       
     3  * $Source: /development/c/demos/folge.c,v $
       
     4  */
       
     5 
       
     6 #include <stdio.h>
       
     7 #include <stdlib.h>
       
     8 #include <math.h>
       
     9 
       
    10 int main (int argc, char **argv)
       
    11 {
       
    12     int N;
       
    13 
       
    14     if (argc != 2) {
       
    15         printf ("Usage: %s <value>\n", argv[0]);
       
    16         return EXIT_FAILURE;
       
    17     }
       
    18 
       
    19     for (N = 1; N <= atoi (argv[1]) + 1; N++)
       
    20         printf ("[2^%d]: %.1f\n", N - 1, pow (2, N - 1));
       
    21 
       
    22     return EXIT_SUCCESS;
       
    23 }