home *** CD-ROM | disk | FTP | other *** search
/ C by Discovery (4th Edition) / C_By_Discovery_4th_Edition.tar / C_By_Discovery_4th_Edition / CH_03 / 175.jpg < prev    next >
Joint Photographic Experts Group Image  |  2013-12-21  |  562KB  |  2550x3300
Labels: binder | book | crt screen | poster | reckoner
OCR: Floating Point Types 175 print result void print result( float x1, float yl, float x2, float y2 float slope, int, Check for vert ical line X1 the line not vert cal cal culate the lope and intercept S. ope y2 y1 1 (x2 - X1 int slope X1 Check for hor izontal line Lope hori zont tal line printf "The equat .on .2f\n" y1 ); else printf "The equati icn pr intf( 5 2fx lope, int ); 36 verti cal line printf( "The equat ion The program consists of the functions ma in and print resul The program uses pri intf calls for prompts and for the output of results Input done with scanf In pr int result () the program checks to see if the line 1 vertical before calculating the slope If this check were not done the calculation of slope might cause an error by attempting to divide by zero Learning Activities In ...