7. a. Write a C program that stores the integer value 15 in the variable num1...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
7. a. Write a C program that stores the integer value 15 in the variable num1 and the inte- ger value 18 in the variable num2. (Make sure to declare these two variables as integers.) Have your program calculate the total of these numbers and their average. The total should be stored in the variable named total and the average in the vari- able named average. (Use the statement average = total/2.0; to calculate the average.) Use the printf() function to display the total and average. b. What data type did you have to declare for the average to ensure that the correct answer was calculated and displayed? 7. a. Write a C program that stores the integer value 15 in the variable num1 and the inte- ger value 18 in the variable num2. (Make sure to declare these two variables as integers.) Have your program calculate the total of these numbers and their average. The total should be stored in the variable named total and the average in the vari- able named average. (Use the statement average = total/2.0; to calculate the average.) Use the printf() function to display the total and average. b. What data type did you have to declare for the average to ensure that the correct answer was calculated and displayed?
Expert 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 computer network questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
A decline in the aggregate demand has led to a decline in output in the economy equal to $10 billion. Government wants to counter this recession by reducing income taxes. Assuming that the marginal...
-
1. According to Illustration Capsule 3.1, which companies comprise the strategic group of firms to which Anheuser-Bush belong? Why is the circle containing Anheuser-Bush and Inbev name larger than...
-
A pond of water at 0C is covered with a layer of ice 4.00 cm thick. If the air temperature stays constant at &10.0C, how long does it take for the ice thickness to increase to 8.00 cm?
-
A proton has mass \(m_{p}\) and charge \(+e\). The force it exerts on another proton at a distance \(r\) is given by \(F(r)=\frac{1}{4 \pi \in_{0}} \frac{e^{2}}{r^{2}}\) where \(\frac{1}{4 \pi...
-
Assume that the step machine in SE3 has an estimated useful life of 8,000 hours and was used for 2,400 hours in year 1; 2,000 hours in year 2; 2,200 hours in year 3; and 1,400 hours in year 4. How...
-
Question 1 Which class is needed to read data from the console? Input System Reader Scanner 1 pts
-
What is the role of accounting in business?
-
Question 4: (6 points) a. An investor has a certain sum of money from which he wants to invest two-thirds in stocks, one quarter in a savings account, and the remaining $100,000 in whatever the...
-
You borrow a $ 324355 add-on interest loan from the credit union and will repay in equal installments over 10 years. The nominal rate of interest is 4.19 %. Assuming quarterly repayment and simple...
-
What must balance with the Customer Payment total in the Paid Documents row
-
If a stakeholder really wants the result of a project and is funding it, how would you characterize him or her? With both high interest and influence High interest but low influence Low interest but...
-
Carol had a universal life insurance policy with a death benefit of $100,000. The policy had a cash value of $18,000. They noticed that she had marked death benefit option B and made Michael the sole...
-
Madison purchased a new car for $23,000. She was allowed $2,000 for her trade in and financed the remainder over 48 months at a rate of 4% per year. How much is her monthly payment?
-
Solve the partial differential differential by separation of variables 3 + 7 = 0. = 0.
-
The outer loop controls the number of students. Note that the inner loop of this program is always executed exactly three times, once for each day of the long weekend. Modify the code so that the...
-
Abigail (Abby) Boxer is a single mother working as a civilian accountant for the U.S. Army. Her Social Security number is 676-73-3311 and she lives at 3456 Alamo Way, San Antonio, TX 78249. Helen,...
-
Janie graduates from high school in 2012 and enrolls in college in the fall. Her parents pay $4,000 for her tuition and fees. a. Assuming Janie's parents have AGI of $170,000, what is the American...
-
Carol Harris, Ph.D, CPA, is a single taxpayer and she lives at 674 Yankee Street, Durham, NC 27409. Her Social Security number is 793-52-4335. Carol is an Associate Professor of Accounting at a local...
-
Which of the following best describes the underlying rationale for a written investment policy statement (IPS)? A. A written IPS communicates a plan for trying to achieve investment success. B. A...
-
Which of the following is least important as a reason for a written investment policy statement (IPS)? A. The IPS may be required by regulation. B. Having a written IPS is part of best practice for a...
-
A written investment policy statement (IPS) is most likely to succeed if: A. Created by a software program to assure consistent quality. B. It is a collaborative effort of the client and the...
Study smarter with the SolutionInn App