home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / SASC6571.LZX / examples / cover / test.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-24  |  499 b   |  37 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int test2(int);
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8.    int num;
  9.  
  10.    if(argc<2)
  11.    {
  12.       fprintf(stderr, "USAGE: test <number>\n");
  13.       exit(20);
  14.    }
  15.  
  16.    num = atoi(argv[1]);
  17.    if(num < 0)
  18.    {
  19.       printf("Number is negative\n");
  20.    }
  21.    else if(num<10)
  22.    {
  23.       printf("0 <= Number < 10\n");
  24.    }
  25.    else if(num <100)
  26.    {
  27.       printf("10 <= Number < 100\n");
  28.    }
  29.    else
  30.    {
  31.       printf("Number >= 100\n");
  32.    }
  33.  
  34.    test2(num);
  35.  
  36.    return(0);
  37. }