Subj : Re: Dartmouth BASIC to C To : comp.programming From : Gerry Quinn Date : Sun Aug 07 2005 03:04 pm In article , JSmith@mail.net says... > Having nothing better to do on a Saturday morning, I was looking at > Kemeny & Kurtz's 1964 manual for BASIC: > > http://www.bitsavers.org/pdf/dartmouth/BASIC_Oct64.pdf > > Below is a C port of the first example program given in the manual. Can > it be improved while preserving, as much as possible, the structure of > the original BASIC program? > if(D == 0.0) > { > printf("no unique solution\n"); > exit(EXIT_FAILURE); > } This isn't a good use of exit(). The program hasn't failed, the data has. Since the data error was detected, the program can congratulate itself on a successful run. (Technically the data is embedded in this program, but that is presumably something you will be changing over time.) So you should just print the above message and return normally. - Gerry Quinn .