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

  1.         /* General form test program for scientific functions */
  2.  
  3.         /* Routine Tested:  PLYADD */
  4.  
  5.         main()
  6.  
  7.         {
  8.         int *fp,i,nda,ndb,ndc;
  9.         static float a[7]={1.,2.,3.,4.,5.,6.,7.},
  10.                      b[7]={1.,3.,5.,7.,9.,0.,0.};
  11.         float c[7];
  12.  
  13.         nda = 6;
  14.         ndb = 4;
  15.  
  16.         plyadd(a,nda,b,ndb,c,&ndc);
  17.  
  18.         *fp=fopen("PRN:","w");                 /* open the printer */
  19.  
  20.         fprintf(*fp,"Test Results from PLYADD\n\n");
  21.          printf("Test Results from PLYADD\n\n");
  22.  
  23.         fprintf(*fp,"  NDC: %6.3d\n",ndc);
  24.          printf("  NDC: %6.3d\n",ndc);
  25.  
  26.         for(i = 0; i <= 6; i++)
  27.         {
  28.         fprintf(*fp,"%9.5f\n",c[i]);
  29.          printf("%9.5f\n",c[i]);
  30.         }
  31.       }
  32.