Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started