Question: Please answer the queston (in terms of C programming) and explain answer End of Semester 1, 2016 COMP1004 Engineering Programming Question 1 Fundamentals (20 marks)

 Please answer the queston (in terms of C programming) and explain

Please answer the queston (in terms of C programming) and explain answer

End of Semester 1, 2016 COMP1004 Engineering Programming Question 1 Fundamentals (20 marks) 1(a) The following C program has three (3) syntax errors/warnings in it when compiled. Identify and correct the errors by stating the line number where they occur. Note: In Line 310, the line overflow is not an error [3 marks cach, 9 marks in total] 10 #include 20 #include 30 40 #define PIE 3.14159 50 60 int main(void) 70 80 define the required variables/ 90 int length; 100 float ext_diam, int_diam, ext_rad, int_ rad; 110 float area, volume, mass 120 const float density= 8030.0; 130 140 150 prompt and get values 160 printf ("input the external diameter of the pipe in metres:") 170 scanf ("f", ex: diam); 180 printf ("input the internal diameter of the pipe in metres: " 190 scanf (",int diam); 200 210 do calculations area of pipe cross-section, volume 220 of pipe and mass of pipe / 230 240 ext rad ext diam 2.0 250 int rad int_diam2.0 260 270 area(PI ext rad ext rad (PT pow (inc rad, 2)) 280 Eor(length 1length 10;iengh+) volume area length (Eloar) mass volumedensity printf ("The mass of the pipe of length im is 290 Ekg ", length, mass); 320 330 340 return 0 350

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!