Question: The following code has 5 different errors. The errors can be any of three types i.e., (compile and syntax execution (run-time errors), or logic errors.

The following code has 5 different errors. The errors can be any of three types i.e., (compile and syntax execution (run-time errors), or logic errors. There logic errors. may be more than one error of the same type. A line may contain more than one error. Find and correct the in the code, i.e, write the incorrect line(s) and the same line(s) as corrected. Assume that the proper header files have been included./*Program calculates the average of two integers. */int main(); int{nbr1 nbr2; float avg; printf (" Enter two integers: "); scanf ("%lf %lf ", &nbr1, &nbr2); */calculates the average/* avg = nbr1 nbr2/2; printf(" The average is: ", avg); return 0;} Write the line(s) containing the 1^st error and correct the line(s). Write the line(s) containing the 2^rd error and correct the line(s). Write the line(s) containing the 3^rd error and correct the line(s). Write the line(s) containing the 4^th error and correct the line(s)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
