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...
-
A survey is taken of 100 people who vacationed at a dude ranch The following information was obtained: 17 took horseback-riding lessons, attended the Saturday night barbecue, and purchased a tour...
-
Crates of tea should contain 200 kg, but it is known that 1 out of 45 crates, on average, is underweight. A sample of 630 crates is selected at random. a. Find the probability that more than 12 but...
-
Wayne Robichaud, Attorney, P.C., began the year with total assets of \($127,000\), liabilities of \($78,000\), and stockholders equity of \($49,000\). During the year the business earned rev enue of...
-
Cypress Oil Companys December 31, 2013, balance sheet listed $645,000 of notes receivable and $16,000 of interest receivable included in current assets. The following notes make up the notes...
-
1. Un cylindre contient 0,020 m d'oxygne molculaire temprature 25C et pression de 15 atm. Quel serait le volume de ce gaz une pression d'une atmosphre? Un patient respire cet oxygne l'aide d'un...
-
Comparative balance sheets for 2024 and 2023 and a statement of income for 2024 are given below for Metagrobolize Industries. Additional information from the accounting records of Metagrobolize also...
-
Mega Skateboard Supplier had net sales of $ 3 . 7 million, its cost of goods sold was $ 1 . 4 million, and its net income was $ 0 . 9 million. What will be Its gross margin ratio?
-
Suppose: Money supply $80 million Price level = $5.00 Velocity of circulation = 4 times a) Determine the quantity of output, T b) If there is an increase in the money supply by 6% determine the new...
-
Describe the various functions involved in interrupt handling. Indicate the hardware and software that might be involved in their implementation. Discuss the interaction of interrupt driven software...
-
Consider the following statistics for Freedonia GDP Population P 1 9 8 0 $ 7 0 billion 5 . 1 million 2 0 0 0 $ 1 0 0 billion 5 . 3 million Calculate GDP pr capita for the two years ( 6 pts ) By what...
-
You are the audit senior at T & C Chartered Accountants, an audit firm that was established five years ago. In your firm, you have an audit partner with ten years experience , three audit managers...
-
Compare inodes used in Linux and NTFS. Are they the same? If not, which one is better? 2) Compare the forensic tools for UNIX environments (e.g, the Sleuth and TCT) with tools for Windows...
-
28) Stock W has the following returns for various states of the economy: State of the Economy Probability Stock W's Return Recession 10% 30% Below Average 20% 2% Average 40% 10% Above Average 20% 18%...
-
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...
-
Fill in the Blank. In the finite element method, \(a(n)\) ___________ solution is assumed within each element.
-
The stiffness matrix of a bar element is given by a. \(\frac{E A}{l}\left[\begin{array}{ll}1 & 1 \\ 1 & 1\end{array} ight]\) b. \(\frac{E A}{l}\left[\begin{array}{rr}1 & -1 \\ -1 & 1\end{array}...
-
What is the basis for the derivation of transformation matrices?
Study smarter with the SolutionInn App