The following C program has three (3) syntax errors/warnings in it when compiled. Identify and correct...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The following C program has three (3) syntax errors/warnings in it when compiled. Identify and correct the errors by stating the line number where they occur [2 marks each, 6 marks in total]. 10 #include <stdio.h> #include <math.h> 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 #define PI 3.14159 #define g 9.807 int main() { FILE *fp; float length, period; float length_start, length_end; fp-fopen("pendulum.dat", "w"); printf("Enter the starting length "); scanf("%f", &length_start); length_end = length_start + 20; for (length=length_start; length<-length_end; length=-length+1) g = length/g; period = 2 * PI * sqrt (g); printf(fp,"%f %f\n", length, period); fclose(fp); return 0; The following C program has three (3) syntax errors/warnings in it when compiled. Identify and correct the errors by stating the line number where they occur [2 marks each, 6 marks in total]. 10 #include <stdio.h> #include <math.h> 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 #define PI 3.14159 #define g 9.807 int main() { FILE *fp; float length, period; float length_start, length_end; fp-fopen("pendulum.dat", "w"); printf("Enter the starting length "); scanf("%f", &length_start); length_end = length_start + 20; for (length=length_start; length<-length_end; length=-length+1) g = length/g; period = 2 * PI * sqrt (g); printf(fp,"%f %f\n", length, period); fclose(fp); return 0;
Expert Answer:
Answer rating: 100% (QA)
Based on the provided image of the C program here are the syntax errorswarnings identified 1 Line 220 The formula for calculating the period of a pend... 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
-
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...
-
Consider the following dataset of predicted scores and actual target values (you can assume higher scores should be assigned to the goods). Calculate the classification accuracy, sensitivity, and...
-
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...
-
Vijay Company reports the following information regarding its production costs. Compute its production cost per unit under absorption costing. Direct materials.................................. $ 10...
-
Evaluate the deficiencies in internal controls and corporate governance at Navistar. Do you believe external auditors should be expected to discover fraud when a company, such as Navistar, is so...
-
Assume Highline Company has just paid an annual dividend of $0.96. Analysts are predicting an 11% per year growth rate in earnings over the next five years. After then, Highlines earnings are...
-
Which type of audit involves a review of general and application controls, with a focus on determining if there is compliance with policies and adequate safe guarding of assets? a. information...
-
A severe winter ice storm has swept across North Carolina and Virginia followed by more than a foot of snow and frigid, single-digit temperatures. These weather conditions have resulted in numerous...
-
The shaft shown is subjected to a completely reversed torsion. The shaft is machined from a high-carbon steel [S = 89000 Psi (615 MPa), S, = 55000 Psi (380 MPa)]. Determine the number of the cycles...
-
Elizabeth is moving from a one bedroom apartment in one city to a similar apartment in another city. She has been quoted a flat fee for the truck rental and has two estimates for wages of the movers...
-
After a court action brought by Jennifer, Jennifer was awarded $ 1 , 0 0 0 in damages from John because she proved by a preponderance of the evidence that John damaged her scooter. What type of law...
-
what ways do sociological theories such as structural functionalism, conflict theory, and symbolic interactionism offer distinct perspectives on the nature of social order, change, and stability ?
-
The HR department at Clearwater Electronics has been asked to develop a job description for a new managerial position in Dubai. Clearwater's policy states that subsidiary managers should be employees...
-
Research your state laws and regulations online and answer the following: 1. Has your state adopted any laws, rules/regulations, or any other kind of standards about "adverse events," "never events,"...
-
Starting from the short-term state of the economy obtained under 1, add now to the same AS- AD setting the effect of the increase in global commodity prices ensuing the war in Ukraine. How do the...
-
The following accounts were taken from the Adjusted Trial Balance columns of the end-of-period spreadsheet for April 30, for Finnegan Co.: Accounts Amount Accumulated Depreciation $32,000 Fees Earned...
-
The demand function for corn is q = 200 - p and the supply function is q = 50+0.5p. (a)What are the quilibrium prices and quantities? (b) The government sets the price of corn at 150 and agrees to...
-
D Which of the following is considered part of the Controlling activity of managerial accounting? O Choosing to purchase raw materials from one supplier versus another O Choosing the allocation base...
-
Mike purchases a heavy-duty truck (5-year class recovery property) for his delivery service on April 30, 2012. The truck is not considered a passenger automobile for purposes of the listed property...
-
Professor Patricia (Patty) Pate is retired from the PalmSprings Culinary Arts Academy (PSCAA). She is a single taxpayer and is 68 years old. Patty lives at 98 Colander Street, Henderson, NV 89052....
-
Harold Conners (Social Security number 785-23-9873) lives at 13234 DeMilo Drive, Houston, TX 77052, and is self-employed for 2012. He estimates his required annual estimated tax payment for 2012 to...
-
Market economies largely rely on a(n) _________ decision- making process, where literally millions of individual producers and consumers of goods and services determine what will be produced.
-
With no alternative use of the government purchases from a price floor, a(n) _________ will result because consumers are consuming _________ than the previous market equilibrium output and sellers...
-
Because of scarcity, certain economic questions must be answered regardless of the level of affluence of the society or its political structure. Three fundamental questions that inevitably must be...
Study smarter with the SolutionInn App