home *** CD-ROM | disk | FTP | other *** search
- /* General form test program for scientific functions */
-
- /* Routine Tested: SORT2 */
-
- main()
-
- {
- int *fp,i; /* utility variables */
-
- int n = 5;
- static float a[5] = {6.1,5.1,4.1,3.1,2.1};
- static float b[5] = {1.0,2.0,3.0,4.0,5.0};
-
- *fp=fopen("PRN:","w"); /* open the printer */
-
- sort2(a,b,n); /* call the function */
-
- fprintf(*fp,"Test Results from function SORT2\n\n");
- printf("Test Results from function SORT2\n\n");
-
- fprintf(*fp," a b\n"); /* label columns */
- printf(" a b\n");
-
- for (i=0; i<=n-1; i++) /* print results */
- {
- fprintf(*fp,"%5.1f %5.1f\n",a[i],b[i]);
- printf("%5.1f %5.1f\n",a[i],b[i]);
- }
- }