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...
-
Discuss the deficiencies in the work done by Deloitte for Navistar with respect to the AICPA Code of Professional Conduct?
-
Days cash on hand Financial statement data for years ending December 3 1 for Newton Company follow: Line Item Description 2 0 Y 9 2 0 Y 8 Cash ( end of year ) $ 2 5 , 9 0 0 $ 2 3 , 4 0 0 Short - term...
-
You are auditing the financial statements of Aardvark Wholesalers, Inc. (AW), a wholesaler with operations in 12 western states and total revenues of about $125 mil lion. You are carrying out an...
-
On January 1, 2013, Warren Corporation had 1,000,000 shares of common stock outstanding. On March 1, the corporation issued 150,000 new shares to raise additional capital. On July 1, the corporation...
-
Example 1 m y Given: The area as shown. Find: The centroid location (x, y) Plan: Follow the steps. 1 m x
-
Sundream Travel Agency Ltd. is a company that sells vacation packages and has a new Chief Executive Officer (CEO) who is reviewing the draft December 31 year-end financial statements prepared by the...
-
Cara has a basis of $6,000 in a classic Mercedes that she purchased several years ago. This year, she sold the Mercedes to a business associate for $18,000. The buyer made the first of six annual...
-
How do sociological perspectives on gender, sexuality, and intersectionality inform our understanding of power dynamics, social movements, and systems of oppression within patriarchal societies ?
-
5. Fill in the truth table corresponding to the transistor-level circuit shown below. A. B. B A B C OUT 0 0 00 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 OUT
-
We know from our reading that changes in net exports is one of four factors that might cause a shift in aggregate demand. So what's happening now? Take a look at the most recent figures from the...
-
13. What is an audit opinion? 14. A company has $235,000 in credit sales. The company uses the allowance method to account for uncollectible accounts. The Allowance for Doubtful Accounts now has a...
-
In the program below, after the declaration of the string text, what does text[4] contain (expressed as a character rather than as a number)? int main() { } char text[] = "lion";
-
Create a Business Plan for Women's Specialized Sports Sneakers. Must include: Executive Summary, Business Description, Industry Analysis, Marketing Plan, Operational Plan, Financial Plan, and...
-
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....
-
In competitive markets, with large numbers of buyers and sellers at the market equilibrium price and quantity, the net gains to society are _________ as possible.
-
Because the _________ leads to the production of more than the efficient level of output, a(n) _________ results.
-
The size of the deadweight loss from a tax, as well as how the burdens are shared between buyers and sellers, depends on the relative _________.
Study smarter with the SolutionInn App