What are the values of sum1 and sum2

Assignment Help C/C++ Programming
Reference no: EM13939598

Let the function fun be defined as

int fun(int *k) {
*k += 4;
return 3 * (*k) - 1;
}

Suppose fun is used in a program as follows
void main() {
int I = 10, j = 10, sum1, sum2;
sum1 = (I / 2) + fun(&i);
sum2 - fun(&j) + (j / 2);
}

What are the values of sum1 and sum2

a. if the operands in the expressions are evaluated left to right?

b. If the operands in the expressions are evaluated right to left?

Reference no: EM13939598

Questions Cloud

What is the value today of a security that promises to pay : What is the value today of a security that promises to pay $1,000 in one quarter, with payments increasing at 1% per quarter thereafter? Payments are made each quarter forever. Our opportunity cost of capital is 12% per annum.
Student suffering financial hardship : A written statement of approximately 200 words outlining what new opportunities a bursary will assist a student suffering financial hardship, to continue their studies.
Describe the main points of the drug-control program : Write a report that summarizes the information that the document provides about each major drug category. Briefly describe the main points of the drug-control program that the document outlines. Be sure to address the following questions: What t..
Arithmetic and geometric returns for the stock : A stock has had returns of 12 percent, 19 percent, 21 percent, −12 percent, 26 percent, and −5 percent over the last six years. What are the arithmetic and geometric returns for the stock?
What are the values of sum1 and sum2 : If the operands in the expressions are evaluated right to left?
Compute the levered bheta : We have the X firm on which we have the following information. Its bheta unlevered is 3, its D/E is 4/1, and its tax rate is .3. Additionally we know that the default free rate is 5% and the stock market has returned 11 % over a long period of time. ..
Problem regarding the state leaders-politicians : You are required to select one of the famous (current or past) state leaders/politicians from the List A and one of the famous (current or past) CEOs from the List B.
Business report on application of cultural approaches : Description/Focus: Business Report on application of cultural and critical approaches to an Australian Organization.
Calculate after-tax cash flow at disposal : Genetic Insights Co. purchases an asset for $11,576. This asset qualifies as a seven-year recovery asset under MACRS. The seven-year fixed depreciation percentages for years 1, 2, 3, 4, 5, and 6 are 14.29%, 24.49%, 17.49%, 12.49%, 8.93%, and 8.93%, r..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Series of different lengths

Before you enter the series, you are to have the program ask the user how many marks there are. After the last mark is entered, show the average of the inputted marks, rounded to 1 decimal point. Test your program to ensure that it works for serie..

  Use the top-down modular approach to design program

Use the top-down modular approach and pseudocode to design a suitable program to solve it. Where appropriate, use defensive programming techniques.

  Write a function to calculate tax

write a function to calculate tax, the sample output is : Filing Status (1) Single (2) Married (3) Head of Household (0)

  Compute the volume of write-back traffic in bytes

Compute the volume of write-back traffic in bytes. Provide a plot of the miss rate vs. the line size for line sizes of 32 bytes to 2 Kbytes. Note that line sizes are a power of 2.

  Emulates the behavior of a bus

Write a program that emulates the behavior of a bus. The bus must have a schedule ( a finite number of times for it to stop) and a certain capacity (number of passengers). In this program the bus has two states: stopped and going.

  Write a switch-case programming for calculation

How to use C++ to write a switch-case programming for calculation? Test the program for a wide range of possible inputs including division by zero and square root of negative values.

  Multiple heaps

Create an application that has two heaps. Place a linked list into each heap. Select one hundred random numbers. Place each of the random numbers into each heap - CSI 345 - Spring 2014 S2

  Creating class perform computation and display results

Create a class named Numbers whose Main() method holds two integer variables. Assign values to the variables. Within the class, create two methods, Sum () and Difference (), that compute the sum of and difference between the values of the two vari..

  Develop a class event to model events scheduled

After all the events have been entered, the program should display a schedule of events in chronological order. Attached are the program files for structure/class and sorting. I need in c++ hide problem

  Write a function that takes two point arguments

Write a function that takes two POINT arguments and returns the midpoint between them and define a function distance() that takes two POINT arguments and returns the distance between them.

  Create a class called rational for performing arithmetic

Rational Class Create a class called Rational for performing arithmetic with fractions. Write a program to test your class. Use integer variables to represent the private data of the class-the numerator and the denominator. Provide a constructor th..

  A password must have at least eight characters

A password must have at least eight characters. A password must consist of only letters and digits. A password should contain at least one uppercase letter. A password must contain at least two digits.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd