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

  1.         /* General form test program for scientific functions */
  2.  
  3.         /* Routine Tested:  SORT  */
  4.  
  5.         main()
  6.  
  7.         {
  8.         int *fp,i;                           /* utility variables */
  9.  
  10.         int n = 10;
  11.         static float a[10] = {4.1,-.5,-10.0,1.,3.4,4.3,3.6,10.1,-10.1,0.};
  12.  
  13.         *fp=fopen("PRN:","w");                 /* open the printer */
  14.  
  15.         sort(a,n);                          /* call the function */
  16.  
  17.         fprintf(*fp,"Test Results from function SORT\n\n");
  18.          printf("Test Results from function SORT\n\n");
  19.  
  20.         for (i=0; i<=n-1; i++)               /* print results */
  21.          {
  22.           fprintf(*fp,"%5.1f\n",a[i]);
  23.            printf("%5.1f\n",a[i]);
  24.          }
  25.         }
  26.  
  27.