1. Engineering
  2. Computer Science
  3. fundamentals 10 marks 1 the following c program contains 3...

Question: fundamentals 10 marks 1 the following c program contains 3...

Question details

Fundamentals (10 marks) 1. The following C program contains 3 (three) syntax errors and 1 (one) logical error. State the line numbers where the errors occur (1 mark each) and rectify these errors (1 mark each). You have to specify the error types. 8 marks] 10 This program asks the user to enter an angle in degrees / 20 and calculates the tangent of this angle / 30 and then prints the result / 40 50 #include <stdio.h> 60 #include <math.h> 70 80 #de fine p13.1415 90 100 110 120 int main (void) 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 float angle float tangent; printf (Enter an angle in degrees ) scanf (%f, &angle) ; if ( angle -360 Il angle K 360) tangent-tan (angle 2 PIE/360.0) printf(The tangent of %,2E is %.2f\n, angle, tangent); else printf (The angle entered is outside the rangeln) return 0:
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution