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
Neko [114]
3 years ago
9

Functional side effects: 15) Given the following Java/C++ like code. Assuming function calls (operands) are evaluated from left-

to-right, one at a time. a) What outputs are printed to the screen? int a = 4; // global variable int fun1() { a = 2; return 3; } int fun2() { return a; } void main() { int x = fun1() + fun2(); System.out.println("x = " + x); } Answer: x = b) What outputs are printed to the screen? int a = 4; // global variable int fun1() { a = 2; return 3; } int fun2() { return a; } void main() { int x = fun2() + fun1(); System.out.println("x = " + x); } Answer: x =
Computers and Technology
1 answer:
tigry1 [53]3 years ago
7 0

Answer:

a. x = 5

b. x = 7

Explanation:

a)

OUTPUT: x = 5

In the main() function, fun1() is evaluated first and it updates the value of the global variable to 2 and returns 3.

The second function returns the value of the global variable 'a' and this variable has value 2.

So,

x = 3 + 2

x = 5

b)

OUTPUT: x = 7

In the main() function, fun2() is evaluated first and it returns 4 because global variable 'a' is initialized with value 4.

The second function fun()1 will returns the value 3.

So,

x = 4 + 3

x = 7

You might be interested in
Which of the following is not a negative environmental effect associated with cars? A. Deforestation B. Roadside litter C. Toxic
777dan777 [17]

Answer:

The answer to this question is the option "C".

Explanation:

In this question, the answer is option C. Which is river toxic pollution. This pollution is also known as Kim Kim river toxic pollution. In 2019 this pollution occurred in the water caused by unauthorized chemical garbage dumping in the river in Malaysia. The unauthorized dumping released poisonous fumes, affecting six thousand people are hospitalized in 2,775.

8 0
3 years ago
A(n) ______ network is a system that attempts to imitate the behavior of the human brain. Group of answer choices advanced neura
larisa [96]

Answer:

Neural Networks

Explanation:

Neural networks are networks that mimic the behaviour of the human brain in which they tend to perform a task without been programmed with the task rule, although the neural network are artificial in nature and they often recognize patterns.

Neutral network have cell that enable them to carry out task together in order to produce a desired result and the cell can only solve a little part of tasks.

6 0
3 years ago
un diagrama de flujo donde se gana una partida de ajedrez teniendo en cuenta los movimientos de la otra persona
mash [69]
Estoy tan confundido. ? estas haciendo una pregunta?

7 0
3 years ago
Easy Bib and Cite This For Me are examples of online
motikmotik
The answer is:  [A]:  "bibliographic generators" .
____________________________________________________
5 0
3 years ago
Let's get into some looping. Sometimes it is nice to generate your own data. Now let's take our first stab at it.
valkas [14]

Answer:

55

Explanation:

3 0
3 years ago
Other questions:
  • What term best describes the way the dns name space is organized?
    9·1 answer
  • What options of the hierarchical star topology within the ANSI/TIA-568-C allow the ability to move the workgroup switches closer
    7·1 answer
  • Which software application offers a variety of templates for creating reports, flyers, and newsletters that you can access withi
    7·1 answer
  • When adding a background to a Web page, it can be _____. a. a solid color b. a fill effect c. an image d. all of the above
    12·1 answer
  • Write a function named "higher_lower" that takes an int as a parameter and returns "higher" if 14 is greater than the input and
    11·1 answer
  • A selected graphic appears surrounded by a(n) ______, which has small squares and circles around its edges.
    7·1 answer
  • What is the effect of this program?
    5·1 answer
  • The file descriptor stderr is represented by the number ____.
    6·1 answer
  • Well the last week has been kind of terrible...
    9·2 answers
  • Vegetable farming is a good source of income explain this statement<br>​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!