Write a program called mydivide that is called at the command line with 2 integer arguments....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program called mydivide that is called at the command line with 2 integer arguments. Include any standard libraries that would be needed. main in mydivide utilises argc and argv as follows, 1. if there are less than 2 arguments that were provided, mydivide returns an error and terminates 2. if there are 2 arguments, convert them to integers using atoi. Atoi is a function that accepts 1 string argument and converts it to an integer (int) 3. if there are two arguments but the 1st integer is smaller than the 2nd, mydivide returns an error and terminates 4. otherwise mydivide divides the 1st argument by the 2nd and prints the result of the division 5. include a function called dbz; this is a signal handler that prints a message stating that we cannot divide by zero. mydivide must use SIGFPE i.e. the floating point exception system signal, and dbz is the handler assigned to manage division by zero errors in mydivide Write a program called mydivide that is called at the command line with 2 integer arguments. Include any standard libraries that would be needed. main in mydivide utilises argc and argv as follows, 1. if there are less than 2 arguments that were provided, mydivide returns an error and terminates 2. if there are 2 arguments, convert them to integers using atoi. Atoi is a function that accepts 1 string argument and converts it to an integer (int) 3. if there are two arguments but the 1st integer is smaller than the 2nd, mydivide returns an error and terminates 4. otherwise mydivide divides the 1st argument by the 2nd and prints the result of the division 5. include a function called dbz; this is a signal handler that prints a message stating that we cannot divide by zero. mydivide must use SIGFPE i.e. the floating point exception system signal, and dbz is the handler assigned to manage division by zero errors in mydivide
Expert Answer:
Answer rating: 100% (QA)
Certainly based on the instructions provided in the image heres a simple C program that fulfills the requirements c include include include Signal han... View the full answer
Related Book For
Chemical Principles The Quest For Insight
ISBN: 9781464183959
7th Edition
Authors: Peter Atkins, Loretta Jones, Leroy Laverman
Posted Date:
Students also viewed these programming questions
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
Write a program called ezstart.py that: a. In a comment on the first line gives your full name (first and last). b. Creates a string variable called myname that's equal to your name. c. Creates an...
-
The inequality describes the range of monthly average temperatures T in degrees Fahrenheit at a certain location. (a) Solve the inequality. (b) If the high and low monthly average temperatures...
-
In June 2014, the nominal interest rate on a one-year Treasury bill was 0.10 percent. From June 2014 to June 2015, the consumer price index rose from 237.3 to 237.8. If you bought the one-year...
-
Otis is the CEO of Rectify, Inc., a private foundation. Otis invests $500,000 (80%) of the foundations investment portfolio in derivatives. Previously, the $500,000 had been invested in corporate...
-
Use the gasoline mileage data in Table B. 3 and compute the condition indices and variance-decomposition proportions, with the regressors centered. What statements can you make about...
-
Ferris Bueller, Inc., owns a building in Des Moines, Iowa, that was built at a cost of $5,000,000 in 2000. The building was used as a manufacturing facility from 2001 to 2010. However, economic...
-
labour cost. Last year, the company sold 30,000 of these balls, with the following results: Sales (30,000 balls) $750,000 Variable expenses Contribution margin 450,000 300,000 Fixed expenses...
-
Instructions You are expected to read the article titled: Risk mitigation in IT outsourcing strategy revisited: longitudinal case research at LISA, and answer the case study questions in the next...
-
Auditors have to make judgments concerning materiality on every audit. Since the auditing standards give no formal guidance for how to determine materiality, auditors must rely on their own...
-
Determine the following: a. Vertical reaction at point A. b. Horizontal reaction at point A. c. Moment reaction at point A d. Vertical reaction at point G e. Horizontal reaction at point G f....
-
The uniform rod in the figure below weighs 420 lb and has its center of www gravity at G. Determine the tension in the cable and the reactions at the smooth surfaces at A and B. B MATHalino.com G...
-
A dam has been constructed across a river at a location where the river bed is at RL 154.0 m. The Full Supply Level is at RL 184.0 m and the freeboard is 3.50 m. The spillway is 45.0 m long and the...
-
Consider the uniform beam is subjected to an initial displacement distribution with respect to its original position: Please drive eq2 from eq1 The exact solution for the natural frequency of the...
-
The figure shows a retaining wall constructed on an existing ground where y= 18.0 kN/m and 6' = 36. The wall retains a 4.0 m high backfill consisting of loose sand with y= 18.0 kN/m and 6 = 30. Unit...
-
(b} DNA is polymorphic in nature as a result of various nucleotide conformations. Discuss the flexibility around the B-N-glycosidic bond and the sugar puckers.
-
Feller Company purchased a site for a limestone quarry for $100,000 on January 2, 2019. It estimate that the quarry will yield 400,000 tons of limestone. It estimates that its retirement obligation...
-
Give the systematic name of (a) CH 3 CH=CHCH(CH 3 ) 2 ; (b) CH 3 CH 2 CH(CH 3 )C(CH 3 ) 3 .
-
(a) What is the shape of a ClO 2 + ion? (b) What is the expected OClO bond angle?
-
Use the VSEPR model to predict the shapes of each of the following molecules and identify the member of each pair that forms a liquid with the higher boiling point: (a) PBr 3 or PF 3 ; (b) SO 2 or O...
-
A \(0.70-\mathrm{kg}\) basketball dropped on a hardwood floor rises back up to \(65 \%\) of its original height. (a) If the basketball is dropped from a height of \(1.5 \mathrm{~m}\), how much energy...
-
You drop a ball from rest from a window \(12 \mathrm{~m}\) above the ground, and just before it hits the ground its speed is recorded to be \(14.6 \mathrm{~m} / \mathrm{s}\). What percentage of the...
-
Gravity-powered roller coasters have a motorized chain assembly that hauls the cars up to the top of the first hill. No additional source energy is supplied for the rest of the trip. What is the...
Study smarter with the SolutionInn App