home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!udel!gvls1!jabber!cpp!root
- From: root@cpp.uucp (Rich Bauer)
- Subject: FP formats not linked
- Organization: Critical Path Project
- Date: Wed, 30 Dec 1992 02:35:47 GMT
- Message-ID: <1992Dec30.023547.1076@cpp.uucp>
- Lines: 51
-
- When scanf goes to get the first batting average in this program,
- the program terminates abnormally with the error message:
- "floating point formats not linked"
-
- What does this mean? I can't find it in the manuals, and the code
- is correct as far as I can tell. What's the problem?
-
- ----------------------------------------------------------------------
-
- #include <stdio.h>
-
- void main(void)
- {
- char name[9] [80];
- double b_avg[9];
- int i, h, l;
-
- double high, low, team_avg;
-
- for(i=0;i<9;i++) {
- printf("Enter name %d: ", i+1);
- scanf("%s",name[i]);
- printf("Enter batting average: ");
- scanf("%lf", &b_avg[i]);
- printf("\n");
- }
- high=0.0;
- low=1000.0;
- team_avg=0.0;
- for(i=0;i<9;i++) {
- if(b_avg[i]>high) {
- h=i;
- high=b_avg[i];
- }
- if(b_avg[i]<low) {
- l=i;
- low=b_avg[i];
- }
- team_avg=team_avg+b_avg[i];
- }
-
- printf("The high is %s %lf\n",name[h],b_avg[h]);
- printf("The low is %s %lf\n",name[l],b_avg[l]);
- printf("The team average is %lf",team_avg/9.0);
- }
-
-
- --
- Rich Bauer | UUCP...!dsinc!jabber!cpp!rich
- Critical Path Project Inc | or.....rich@cpp.UUCP
- Philadelphia PA | Public Access, News & Mail
-