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
When choosing a new computer to buy, you need to be aware of what operating _____ a0 it uses.
Alla [95]

System?

ddfdfdfdfdfdddddddddddddddddddddddddddddddddddd

8 0
2 years ago
The Internet began when a large company wanted to sell products online
aalyn [17]
No!The internet began in the 1950s when the US government was trying to use connected computers to compete with the Soviet Union's Sputnik. Hope this helps :)
6 0
2 years ago
PLEASE HELP!!!!!! ASAP
NNADVOKAT [17]

Answer:

use a wizard or use a design view

Explanation:

i took the test

4 0
3 years ago
Read 2 more answers
Select all the correct answers.
gtnhenbr [62]

Answer:

If you want to learn coding than get a game and look at the code inside.

Explanation:

I sugest terraria

8 0
3 years ago
what is the largest possible number of internal nodes in a redblack tree with black height k? what is the smallest possiblenumbe
Elina [12.6K]

Answer:

A Red Black Tree is a type of self-balancing(BST) in this tree ,each node is red or black colored. The red black tree meets all the properties of the binary search tree, but some additional properties have been added to a Red Black Tree.

A Red-Black tree's height is O(Logn) where (n is the tree's amount of nodes).

In a red-black tree with black height k

The maximum number of internal nodes is 2^{2k} -1.

The smallest possible number is 2^{k} -1.

7 0
2 years ago
Other questions:
  • For some people , alcohol can cause an uncontrollable blank of the eyes , making good vision almost impossible
    5·1 answer
  • What is a nonlinear presentation
    9·2 answers
  • When you park facing downhill and there is a curb, turn your wheels _____ the curb. When you park facing uphill and there is a c
    13·2 answers
  • Java languageThe cost to ship a package is a flat fee of 75 cents plus 25 cents per pound.1. Declare a constant named CENTS_PER_
    5·2 answers
  • If you create and invoke a recursive function without accounting for a base case, what can go wrong?
    15·1 answer
  • You have added a table to your web page consisting of two columns and five rows, including the header row. in the first header c
    13·1 answer
  • A student that earns a well qualified score on an ap exam would receive a ___
    13·1 answer
  • Clickable text or image that takes you to a different site
    15·1 answer
  • (Comparable interface) Write Rectangle class that implements the Comparable interface. Override the equals method so that two Re
    12·1 answer
  • Does anyone know how to write this right? This is for a coding class and I’m super confused on it.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!