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

  1.         /* General form test program for scientific functions */
  2.  
  3.         /* Routine Tested:  STCORR */
  4.  
  5.         main()
  6.  
  7.         {
  8.         float r;
  9.         static float x[5]={ 1., 2., 3., 4.,  5.},
  10.                      y[5]={ 5., 3., 0.,-5.,-11.};
  11.         int *fp,n;
  12.  
  13.         *fp=fopen("PRN:","w");                /* open the printer */
  14.         fprintf(*fp,"Test Results from STCORR\n\n");
  15.         printf("Test Results from STCORR\n\n");
  16.  
  17.         n = 5;
  18.  
  19.         stcorr(n,x,y,&r);
  20.  
  21.         fprintf(*fp,"R = %15.7f\n",r);
  22.          printf("R = %15.7f\n",r);
  23.  
  24.         }
  25.