What are values of sum1 and sum2

Assignment Help Computer Engineering
Reference no: EM1331248

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: EM1331248

Questions Cloud

Using computer information systems for medical records : Can you please describe any new legal problems that you see emerging in the future as a result of the widespread use of computer information systems in regards to medical records?
Key trait theories of leadership : Can you identify the key trait theories of leadership and give a brief description of them? If possible can you say which ones, if any, are used nowadays.
Expecting an entitlement of ownership : Do you think that customers are not expecting an entitlement of ownership when they purchase a service or consumers should not be expecting satisfaction from a service not owned?
Annotated bibliography on hrm technologies : Annotated Bibliography on HRM Technologies - The annotated bibliography and resource list provides the opportunity to conduct a literature search concerning existing and possible HRM technologies that can be used in organizations.
What are values of sum1 and sum2 : If the operands in expressions are evaluated left to right. If the operands in the expressions are evaluated right to left? Sum1=48, Sum2=46
Business and cite the opinions of some experts : Are HR workers informed about other areas of the business and Cite the opinions of some experts (journals, etc.) who talk about the issue of how HR can be better integrated with the other actual business areas of an organization.
Illustrate are some of the clever strategies : Illustrate are some of the clever strategies that landlords might use to create a black market.
Equal employment opportunity commission : Explain how the complaint begins with the Equal Employment Opportunity Commission (EEOC) and proceeds through the civil litigation process from the state level up to the United States Supreme Court.
Define the term mixed method design : Define the term mixed method design and identify the advantages and disadvantages of using such a design.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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