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

  1.         /* General form test program for scientific functions */
  2.  
  3.         /* Routine Tested:  STPLRG  */
  4.  
  5.         main()
  6.  
  7.     {
  8.         int *fp,i,iflag,m,n;
  9.  
  10.         float a[20],c[4];
  11.         static float x[11]={1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.},
  12.                      y[11]={-2.,7.,34.,91.,190.,343.,562.,859.,
  13.                             1246.,1735.,2338.};
  14.  
  15.         m = 11;
  16.         n = 3;
  17.  
  18.        stplrg(m,x,y,n,c,&iflag,a);
  19.  
  20.         *fp=fopen("PRN:","w");             /* open the printer */
  21.  
  22.         fprintf(*fp,"Test Results from STPLRG\n");
  23.          printf("Test Results from STPLRG\n\n");
  24.  
  25.         fprintf(*fp,"   IFLAG =   %d\n\n",iflag);
  26.          printf(   "   IFLAG =   %d\n\n",iflag);
  27.  
  28.         for(i = 0; i <= 3; i++)
  29.         {
  30.           fprintf(*fp,"c[%d] = %f\n",i,c[i]);
  31.            printf(   "c[%d] = %f\n",i,c[i]);
  32.         }
  33.      }
  34.  
  35.