home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-SSP.ARJ / STANVG.TST < prev    next >
Encoding:
Text File  |  1984-08-31  |  1.2 KB  |  41 lines

  1.         /* General form test program for scientific functions */
  2.  
  3.         /* Routine Tested:  STANVG */
  4.  
  5.         main()
  6.  
  7.         {
  8.  
  9.         static float x[16] = {24., 47., 35., 42.,
  10.                               47., 85., 23., 47.,
  11.                               65., 49., 23., 62.,
  12.                               12., 14., 19., 23.},
  13.                      mt[16] = {1, 2, 3, 4,
  14.                                4, 1, 2, 3,
  15.                                3, 4, 1, 2,
  16.                                2, 3, 4, 1},
  17.                      mg[16] = {4, 3, 2, 1,
  18.                                3, 2, 1, 4,
  19.                                2, 1, 4, 3,
  20.                                1, 4, 3, 2};
  21.         float av[23],t[4];
  22.         int *fp,lcx,lcmt,lcmg,n,i;
  23.  
  24.         *fp=fopen("PRN:","w");             /* open the printer */
  25.         fprintf(*fp,"Test Results from STANVG\n\n");
  26.         printf("Test Results from STANVG\n\n");
  27.  
  28.         lcx = 4;
  29.         lcmt = 4;
  30.         lcmg = 4;
  31.         n = 4;
  32.  
  33.         STANVG(lcx,lcmt,lcmg,n,mt,mg,x,av,t);
  34.  
  35.         for (i = 0; i <= 22; i++)
  36.         {
  37.           fprintf(*fp,"av[%d] = %15.7f\n",i,av[i]);
  38.            printf("av[%d] = %15.7f\n",i,av[i]);
  39.         }
  40.      }
  41.