| 1 |
/*********************************************************************** |
| 2 |
* Code listing from "Advanced Linux Programming," by CodeSourcery LLC * |
| 3 |
* Copyright (C) 2001 by New Riders Publishing * |
| 4 |
* See COPYRIGHT for license information. * |
| 5 |
***********************************************************************/ |
| 6 |
|
| 7 |
#include <stdio.h> |
| 8 |
#include <stdlib.h> |
| 9 |
#include "reciprocal.hpp" |
| 10 |
|
| 11 |
int main (int argc, char **argv) |
| 12 |
{ |
| 13 |
int i; |
| 14 |
|
| 15 |
i = atoi (argv[1]); |
| 16 |
printf ("The reciprocal of %d is %g\n", i, reciprocal (i)); |
| 17 |
return 0; |
| 18 |
} |