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

  1.         /* General form test program for scientific functions */
  2.  
  3.         /* Routine Tested:  SIMPS */
  4.  
  5.         main()
  6.  
  7.         {
  8.         int *fp,m;
  9.         static float y[4]={1.386294,1.458614,1.526056,1.589235};
  10.         float xo,xn,simp;
  11.  
  12.         m = 4;
  13.         xo = 4.;
  14.         xn = 5.2;
  15.  
  16.         simps(m,xo,xn,y,&simp);
  17.  
  18.         *fp=fopen("PRN:","w");                 /* open the printer */
  19.  
  20.         fprintf(*fp,"Test Results from SIMPS\n\n");
  21.          printf("Test Results from SIMPS\n\n");
  22.  
  23.         fprintf(*fp," SIMP = %15.7f\n\n",simp);
  24.          printf(" SIMP = %15.7f\n\n",simp);
  25.  
  26.         }
  27.  
  28.