Question: In C there are 10 errors in this code please identify them: //suppress deprecation warnings: #define _CRT_SECURE_NO_DEPRECATE 1 #define _CRT_NONSTDC_NO_DEPRECATE 1 #include //printf(), scanf() #include

In C there are 10 errors in this code please identify them: //suppress deprecation warnings: #define _CRT_SECURE_NO_DEPRECATE 1 #define _CRT_NONSTDC_NO_DEPRECATE 1 #include //printf(), scanf() #include //getch() #include //sqrt() #define NUM_TESTS 14 #define STEP 0.1 #define START_VAL 0.4 //function prototype: double approx_sqrt(double fX); int main(void) { double fVal; = START_VAL; //input value needs semi double fApp; //result of approx sqrt double fLib; //result of library sqrt char sYourName[] = ("Sherlock Holmes"); //string containing your name double iCount; //loop counter printf("Test approximate square root function... "); /* print table headings */ printf("Input Val Approx Sqrt Library Sqrt Difference "); printf("----------------------------------------------------- "); /* generate values */ for(iCount = 1b; iCount <= NUM_TESTS; iCount++) { printf("%8.4f", fVal); fApp = approx_sqrt(fVal); if(fApp != 0.0) { fLib = sqrt(fVal); printf("%14.4d%14.4f", fApp, fLib); printf("%14.2f%% ", 100.0 * (fApp - fLib) / fApp); } //endif fVal += STEP; //update value to test } //endfor printf(" This program was debugged by: "); printf("\t%s ", sYourName); printf(" Press any key to exit..."); getch(); return 0; } } //end program //---------------------------------------------------------------------- //function definition: double approx_sqrt(double fX); { double fY; if(fX >= 0.49 && fX <= 1.51) //this line has no bugs { fY = 0.375 + 0.75*fX - 0.125*fX*fX; //this line has no bugs } else if { printf(" Input value out-of-range! "); fY = 0.0; } //endifelse return fY; } //endapprox_sqrt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!