1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sergij07 [2.7K]
3 years ago
11

Consider the following C program: int fun(int *i) { *i += 5; return 4; } 352 Chapter 7 Expressions and Assignment Statements voi

d main() { int x = 3; x = x + fun(&x); } What is the value of x after the assignment statement in main, assuming a. operands are evaluated left to right. b. operands are evaluated right to left
Computers and Technology
1 answer:
Musya8 [376]3 years ago
4 0

Answer:

a. operands are evaluated left toright. 7

b. operands are evaluated right toleft. 12

Explanation:

a. operands are evaluated left toright. 7

b. operands are evaluated right toleft. 12

left to right

int fun (int *i) {

*i +=5; we add 5to x making x 8

return4; we return 4 tomain

}

void main ( ) {

int x = 3;

x = x + fun(&x); x starts at 3 in fun it ischanged to 8 but the 3 is already being used the 4 fromfun is added (3+4) to it making it 7

}

right toleft x starts at 3 in fun x gets changed to 8 and fun is returned as 4so we have 4 + 8 = 12

Paraphrasing

left to right it's is 3 + 4 =7 original value of x is used

right to left it is 4 + 8 =12 x is used as it was changed by fun, since fun was alreadyexecuted

You might be interested in
Use the arr field and mystery () method below.
kolezko [41]

Answer:

The sum of all positive even values in arr

Explanation:

We have an array named arr holding int values

Inside the method mystery:

Two variables s1 and s2 are initialized as 0

A for loop is created iterating through the arr array. Inside the loop:

num is set to the ith position of the arr (num will hold the each value in arr)

Then, we have an if statement that checks if num is greater than 0 (if it is positive number) and if num mod 2 is equal to 0 (if it is an even number). If these conditions are satisfied, num will be added to the s1 (cumulative sum). If num is less than 0 (if it is a negative number), num will be added to the s2 (cumulative sum).

When the loop is done, the value of s1 and s2 is printed.

As you can see, s1 holds the sum of positive even values in the arr

7 0
2 years ago
Generally, what is the term for storage locations in a processor?
oksano4ka [1.4K]

Answer: Registers

Explanation:

Registers are small storage locations identified by different types of registers. The function of the register is to provide data for immediate processing to the CPU. These registers hold data temporarily and provide easy access of data to the processor.

6 0
3 years ago
What is IBM compadibles
mixer [17]

Answer:

IBM PC compatible computers are computers similar to the original IBM PC, XT, and AT that are able to use the same software and expansion cards. Such computers were referred to as PC clones, or IBM clones

8 0
3 years ago
APPLY
tatiyna

Answer:

i<6 is the "end guard". This means that the loop continues while this is true, and ends when this is false.

i++ is the "continuation", it is the operation executed when the loop continues. i++ increases the value of i by one.

4 0
2 years ago
Which of the following is not true of client-server applications?
Sliva [168]

Answer:

B.

Explanation:

Client-server application is a relationship between a client and a server.

In this relationship, the client (a program) requests a service from the server (the other resource).

The statement that is not true about the client-server applications is they include smart phones, tablets, iPads, laptops, desktop computers.

Rest of the statements concerning client-server relationship are true.

Therefore, option B is the answer.

3 0
3 years ago
Other questions:
  • Which type of multiplexing divides transmission opportunities into slots of 125 microseconds with position inside each slot rese
    10·1 answer
  • What term is used to identify the visual interface that displays information it receives from the computer?
    11·1 answer
  • As a safe driver, you cannot, __________
    13·1 answer
  • Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 3 8 then the outp
    12·1 answer
  • Sebutkan beberapa contoh peralatan komunikasi zaman dahulu beserta dengan keterangannya!
    14·1 answer
  • Witch of the following is a valid why a scientist might a scientific theory
    13·1 answer
  • Are the blank space around the edges of the page
    5·1 answer
  • Subscribe too my you tube channel for a brainiest
    15·1 answer
  • MODERATOR DELETE MY ACC
    8·2 answers
  • What is the difference between margin and padding property?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!