The following C program has three (3) syntax errors in it. Identify and correct the errors...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The following C program has three (3) syntax errors in it. Identify and correct the errors by stating the line number where they occur [2 marks each, 6 marks in total]. 10 20 30 40 /* Program to calculate the area of a cone given the base */ /* radius and height */ 50 60 70 80 90 100 110 120 130 140 150 #include <stdio.h> #include <math.h> 160 170 180 190 200 210 220 230 240 250 int main() ( float radius, height; float volume; constant float PI = 3.1415; printf("Enter the radius at the base of the cone (cm): "); scanf ("%f", &radius); printf("Enter the height of the cone (cm): "); scanf ("%f", &height); PI-PI/3.0; volume = (PI* power (radius, 2) * height); printf("The volume of this cone is %.2f cm^2\n", volume); return 0; The following C program has three (3) syntax errors in it. Identify and correct the errors by stating the line number where they occur [2 marks each, 6 marks in total]. 10 20 30 40 /* Program to calculate the area of a cone given the base */ /* radius and height */ 50 60 70 80 90 100 110 120 130 140 150 #include <stdio.h> #include <math.h> 160 170 180 190 200 210 220 230 240 250 int main() ( float radius, height; float volume; constant float PI = 3.1415; printf("Enter the radius at the base of the cone (cm): "); scanf ("%f", &radius); printf("Enter the height of the cone (cm): "); scanf ("%f", &height); PI-PI/3.0; volume = (PI* power (radius, 2) * height); printf("The volume of this cone is %.2f cm^2\n", volume); return 0;
Expert Answer:
Answer rating: 100% (QA)
Answer Here are the identified syntax errors in the provided C program along with the correct... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Compare Cleveland Clinic's financial ratios for the most recent three years against the national norma and include analytical comments and how the organization compares to the national norms as well...
-
BuyBack Inc. has a debt-equity ratio of 0.75. The earnings for next year are estimated at $225,000.00 whilst capital spending for next year is estimated at $180,000.00. If the company follows a...
-
The following spectra for A and B correspond to two structural isomers. The NMR singlet at (1.16 in spectrum A disappears when the sample is shaken with D2O.The singlet at (0.6 ppm in the spectrum of...
-
The comparative balance sheets for Karidis Ceramics, Inc., for December 31, 209 and 208 are presented on the next page. During 209, the company had net income of $96,000 and building and equipment...
-
Cellular Solutions Inc. had a very successful year in 2013. Based on a $125 average unit selling price, monthly sales during 2013 were as follows: January ............................. $ 75,000...
-
X has a normal distribution, such that P(X > 147.0) = 0.0136 and P(X 59.0) = 0.0038. Use this information to calculate the probability that 80.0 X < 130.0.
-
How do stakeholder groups relevant to environmental management accounting and environmentally induced financial accounting differ?
-
Arnez Company's annual accounting period ends on December 31, 2017. The following information concerns the adjusting entries to be recorded as of that date. (Entries can draw from the following...
-
The following data were included in a recent Zhu and Ramos Incorporated annual report (in millions) Net revenue Net property, plant, and equipment Required: 2915 $ 167,500 15,510 2916 $ 167,910 2917...
-
1. If Bozena participates and the 401(k) earns 10 percent annually, how much will she have accumulated in 45 years (to age 67) even if her salary does not change? 2. If she does not participate and...
-
A mechanism is shown in Figure 3. Crank AB rotates with a constant angular velocity of 4 rad/s (counter-clockwise), the length of AB and BC is 0.6 m and 0.8 m, respectively. At the time instant, the...
-
1. In a simple monetary model of the exchange rate, liquidity preference is a constant, L=5 for both the US and Australia. In the US, the price level is 4. In Australia, the nominal supply of money...
-
A perfectly competitive firm's average variable cost (AVC) is .O5, average fixed cost (AFC) is 1, and total variable cost (TVC) is 22,000. What is this firm's total cost (TC)?
-
Economics Question: How does the money supply affect interest rates in an economy, and what is the role of the central bank in managing the money supply?
-
Sonny Ltd is an upcoming backyard salon situated in Gauteng, South Africa. They have been operating very well ever since they started, the only problem they have is to account for each and every cost...
-
Compare and contrast how Windows systems store user settings with Unix and Linux systems. Which method do you think is more secure? Justify your answer.
-
What are normal microbiota and their function
-
Provide a few individual examples who revealed what aspects of emotional intelligence?
-
Linda and Richard are married and file a joint return for 2012. During the year, Linda, who works as an accountant for a national airline, used $2,100 worth of free passes for travel on the airline;...
-
In the 2012 tax year, Michelle paid the following amounts relating to her 2010 tax return: Tax deficiency..........................................$5,000 Negligence...
-
Matthew borrows $250,000 to invest in bonds. During 2012, his interest on the loan is $30,000. Matthew's interest income from the bonds is $10,000. This is Matthew's only investment income. a....
-
True or False. The element stiffness matrices are always singular.
-
Derive the stiffness matrix of the bar element in longitudinal vibration whose cross-sectional area varies as \(A(x)=A_{0} e^{-(x / l)}\), where \(A_{0}\) is the area at the root (see Fig. 12.14)....
-
Fill in the Blank. In the finite element method, the elements are assumed to be interconnected at certain points known as ____________ .
Study smarter with the SolutionInn App