home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / freq / frq2 / cell.c next >
C/C++ Source or Header  |  1989-01-26  |  2KB  |  74 lines

  1. /*
  2.  *  cell.c
  3.  *
  4.  *  Version 1.1, Public Domain, 30 July 1988
  5.  *  Steve Sampson, Compuserve 75136,626
  6.  *  Distribution unlimited.
  7.  *
  8.  *  This program prints a table of frequencies used by the
  9.  *  Omni(tm) type of Cellular Telephone systems.  Based on
  10.  *  a description by Joe Bartlett, Compuserve 76703,4225.
  11.  *
  12.  *  Compiled using Turbo-C V1.5, Works also under MSC V5.1
  13.  */
  14.  
  15. #include <stdlib.h>
  16. #include <stdio.h>
  17.  
  18.  
  19. main()
  20. {
  21.     register int    i, j, chan, cell;
  22.     float           rx_freq, tx_freq;
  23.  
  24.     /*
  25.      *  Turbo-C will combine all the strings, to save duplicated
  26.      *  memory.  That's why I made them this way.
  27.      */
  28.  
  29.     printf("Cellular Phone Band %c (Channel 1 is Data)\n", 'A');
  30.  
  31.     for (cell = 1, i = 333; i > 312; i--)  {
  32.  
  33.         printf("\nCell # %d\n", cell++);
  34.         printf("--------------------------------------------------\n\n");
  35.  
  36.         for (chan = i, j = 1; j < 17; j++, chan -= 21)  {
  37.  
  38.             if (chan < 1)
  39.                 break;
  40.  
  41.             rx_freq = ((float)chan * .030) + 825.000;
  42.             tx_freq = rx_freq + 45.000;
  43.  
  44.             printf("Channel %d\t(%d)\tTx %3.3f\tRx %3.3f\n",
  45.                     j, chan, tx_freq, rx_freq);
  46.         }
  47.     }
  48.  
  49.     printf("\n\n");
  50.     printf("Cellular Phone Band %c (Channel 1 is Data)\n", 'B');
  51.  
  52.     for (cell = 1, i = 334; i < 355; i++)  {
  53.  
  54.         printf("\nCell # %d\n", cell++);
  55.         printf("--------------------------------------------------\n\n");
  56.  
  57.         for (chan = i, j = 1; j < 17; j++, chan += 21)  {
  58.  
  59.             if (chan > 666)
  60.                 break;
  61.  
  62.             rx_freq = ((float)chan * .030) + 825.000;
  63.             tx_freq = rx_freq + 45.000;
  64.  
  65.             printf("Channel %d\t(%d)\tTx %3.3f\tRx %3.3f\n",
  66.                     j, chan, tx_freq, rx_freq);
  67.         }
  68.     }
  69.  
  70.     exit(0);
  71. }
  72.  
  73. /* EOF */
  74.