Write a program three.c which contains a function (named three) that takes two arguments: a pointer...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program "three.c" which contains a function (named "three") that takes two arguments: a pointer to an int and a pointer to a char. The function should return a float. This function should examine the value pointed at in the first argument. If the value is even, set the value pointed at by the second argument to be an 'E', if it is odd, set the second value to 'O'. Then return the integer pointed at by the first argument reduced by 1 as a float (you will need to cast the result). Finally, increment the first integer. Example Input: 7 Output: 806.0 Here's a copy of the starter code: #include <stdio.h> // Define three here. int main(void) { int a; scanf("%d", &a); char b; float c = three(&a, &b); printf("%d %c %.lf", a, b, c); return 0; } Write a program "three.c" which contains a function (named "three") that takes two arguments: a pointer to an int and a pointer to a char. The function should return a float. This function should examine the value pointed at in the first argument. If the value is even, set the value pointed at by the second argument to be an 'E', if it is odd, set the second value to 'O'. Then return the integer pointed at by the first argument reduced by 1 as a float (you will need to cast the result). Finally, increment the first integer. Example Input: 7 Output: 806.0 Here's a copy of the starter code: #include <stdio.h> // Define three here. int main(void) { int a; scanf("%d", &a); char b; float c = three(&a, &b); printf("%d %c %.lf", a, b, c); return 0; }
Expert Answer:
Answer rating: 100% (QA)
Below is the modified code for threee based on your r... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Write a MATLAB code/script includes calling a function named your first name which returns the area and volume of a cylinder. This code prompts the user to enter the radius (r) and height (h) values...
-
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...
-
Cliff Arthur has equally attractive job offers in Miami and Los Angeles. The rent ratios in the cities are 8 and 20, respectively. Cliff would really like to buy rather than rent a home after he...
-
Air undergoes an Ericsson refrigeration cycle, which is the reverse of the Ericsson power cycle introduced in Sec. 9.8.4. Figure P10.58 provides data for the cycle operating at steady state. Sketch...
-
High school seniors with strong academic records apply to the nations most selective colleges in greater numbers each year. Because the number of slots remains relatively stable, some colleges reject...
-
What levels of an organization benefit most from a data warehouse?
-
On July 1, 2008, Agincourt Inc. made two sales. 1. It sold land having a fair market value of $700,000 in exchange for a 4-year zero-interest-bearing promissory note in the face amount of $1,101,460....
-
A fan blade increases its speed of rotation from 200 revolutions per minute to 250 revolutions per minute in 1 minute. What is the blade's acceleration in rad/s 2 ?
-
Norr and Caylor established a partnership on January 1, 2019. Norr invested cash of $100,000 and Caylor invested $30,000 in cash and equipment with a book value of $40,000 and fair value of $50,000....
-
On April 1 2020 the Dogs Limited rented out part of its property and was paid $24,000 in advance for a 12 month period. The receipt was credited to a liability account. At December 31 2020, Cows...
-
When a spigot is open, water emerges from a garden hose with a speed of 14.53 inches per second. If the garden hose has an opening with a cross-sectional area of 0.63 square inches, what would be the...
-
A noisy generator produces a sound intensity of 0.15 W/m at a distance of 16 m. Find the sound intensity at a distance of 20 m Find the sound level in decibels at that distance At what distance is...
-
2.2. Consider the Cox-Ingersoll-Ross short rate model dr(t) = [a br(t)]dt + or(t)dW+(t), where a, b, o> 0 and where W is a Brownian motion under the risk neutral (martingale) probability P. (a) Show...
-
The future value and present value equations also help in finding the interest rate and the number of years that correspond to present and future value calculations. If a security currently worth...
-
Problem 5 Shown below are the operating results of Bulalacao Company, a large corporation, since its start of operations: 2016 2017 2018 2019 2020 2021 Gross income 4,000,000 4,500,000 5,500,000...
-
An e is in the state with spin wave fue? 3 A = is in the S depresentation, what is the probability of finding the 2-component of it's spin along the =-2 dir.
-
Assume a simple Keynesian depression economy with a multiplier of 4 and an initial equilibrium income of $3,000. Saving and investment equal $400, and assume full employment income is $4,000. a. What...
-
A Betelgeusean plorg has these properties: Data A plorg has a name with no more than 19 letters. A plorg has a contentment index (CI), which is an integer. Operations A new plorg starts out with a...
-
Rewrite Listing 4.4, using the C++ string class instead of char arrays. Here is some sample output for Listing 4.4: Enter your name: Dirk Hammernose Enter your favorite dessert: Radish Torte I have...
-
Suppose you have the following definitions: class Frabjous { private: char fab[20]; public: Frabjous(const char * s = "C++") : fab(s) { } virtual void tell() { cout < < fab; } }; class Gloam {...
-
Evaluate Mephisto Products current approach to sales. Why has it been relatively successful to date?
-
What problems can you anticipate if Tony Bullins goes ahead and changes the sales team and selling philosophy?
-
How does the role of selling tend to differ between: (a) industrial products (B2B)? (b) consumer products (B2C)?
Study smarter with the SolutionInn App