Please answer the question. Semester 2 & Trimester 38, 2015 COMP1004 Engineering
ID: 3905557 • Letter: P
Question
Please answer the question.
Semester 2 & Trimester 38, 2015 COMP1004 Engineering Programming 1 (b) The following C program has three (3) syntax errors/warnings in it when compiled andor might cause a runtime error when executed. Identify and correct the errors by stating the line number where they occur [2 marks each, 6 marks in total) 10 Temperature conversion from Celsius to Farenheit 20r from Farenheit to Celsius. 30 40 #include 50 60 void fahrtocelsius (void): 70 void celsiustofahr (void): 80 90 int main (void) 100 ( 110 int ci 120 130 printf ("Temperature Conversion Table ") 140 printf(" Fahrenheit to celsius Conversionin") printf("2 Celsius to Fahrenheit Converionin") printfEnter your Choice" 150 170 hpd 180 getc): 200 fahrtocelsius O 210 else 220d celsiustofahr 0 else Printe ("Invalid choice ); 230 240 250 return o 260 270 280 int) fahrtocelsius() 290 300 float fahr: 310 for (fahr-0; fahrExplanation / Answer
3 Syntax errors in the given code:
110: int c; It must be char c;
210: else (c=='2'); It must be else if(c=='2');
280: function decleration is not correct; It must be void fahrtocelsius()