6. The following C program cannot be compiled and would not display the correct output. There are four errors in it. Identify which lines contain the error(s), then re-write the correct way to write for each error. 2 3 123456789 B 10 11 12 } // This is a program to calculate the area of a circle #include (stdio.h) main() float radius, area; printf("Radius = ?"); scanf("%f", radius); area = 3.142 radius radius printf('Area = f', area); Error 1 at line - Correct way: Error 2 at line Correct way: - Error 3 at line Correct way: Error 4 at line Correct way:

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter3: Assignment, Formatting, And Interactive Input
Section3.2: Formatting Numbers For Program Output
Problem 10E
icon
Related questions
Question
C programming
6. The following C program cannot be compiled and would not display the correct output.
There are four errors in it. Identify which lines contain the error(s), then re-write the
correct way to write for each error.
2
3
123456789
B
10
11
12 }
// This is a program to calculate the area of a circle
#include (stdio.h)
main()
float radius, area;
printf("Radius = ?");
scanf("%f", radius);
area = 3.142 radius radius
printf('Area = f', area);
Error 1 at line
-
Correct way:
Error 2 at line
Correct way:
-
Error 3 at line
Correct way:
Error 4 at line
Correct way:
Transcribed Image Text:6. The following C program cannot be compiled and would not display the correct output. There are four errors in it. Identify which lines contain the error(s), then re-write the correct way to write for each error. 2 3 123456789 B 10 11 12 } // This is a program to calculate the area of a circle #include (stdio.h) main() float radius, area; printf("Radius = ?"); scanf("%f", radius); area = 3.142 radius radius printf('Area = f', area); Error 1 at line - Correct way: Error 2 at line Correct way: - Error 3 at line Correct way: Error 4 at line Correct way:
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,