Determine the direction of operands

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

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?

Now the answers are: 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? 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? Sum1=46, Sum2=48

b. If the operands in the expressions are evaluated right to left? Sum1=48, Sum2=46

 

Reference no: EM13939272

Questions Cloud

Aware of current competing properties : 1. Market research is the process of:-2. Is it important to be aware of current competing properties when formulating
Prepare the adjusting journal entry to record : Prepare the journal entries to record the interest and principal payments to the lender on May 31, 2011. Prepare the adjusting journal entry to record the interest owed at the end of the accounting period on December 31, 2010.
What are the essential organic nutrients : There are essential nutrients, essential molecular structures for life processes, that we cannot synthesize and must take in, in adequate amounts, with our food. What are the essential organic nutrients? What is their biochemical or metabolic func..
Requirement of communication skills for effective leadership : Communication skills are secondary to technical expertise in effective leadership. Write about requirement of Communication skills for effective leadership.
Determine the direction of operands : If the operands in the expressions are evaluated right to left? Let the function fun be defined as
Evaluate the ethical behavior of manny : Evaluate the ethical behavior of Manny. Should Manny have called Todd in the first place? What if Todd had agreed to meet the lower bid price-would there have been any problems?
Determine the local max local min and absolute max : Determine the local max, local min, absolute max and absolute min for the following equations: f(x) = -3x4 - 8x3 + 11x2 + 26x
Which is a key dimension of customer demand in foreign : Some global enterprises engage in joint research projects to broaden their contacts. What is another reason?
What additional annual cost is the shop incurring : What additional annual cost is the shop incurring by staying with this order size?  Other than cost savings, what benefit would using the optimal order quantity yield?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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