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
Select the levels of data backup.
navik [9.2K]
What levels r right and we can pick from??
6 0
4 years ago
I need the answer ASAP!!!! I’ll mark brainliest if correct
Anvisha [2.4K]

Answer:

Option D

Explanation:

option d component level design model is the correct answer

4 0
3 years ago
Which of the following describes an executive information system (EIS)?
rjkz [21]
I think the answer is b

hope this helps :)
3 0
3 years ago
You can use your student ID card to get discounts in all of the following except
Anna007 [38]

tuition - apex

hope it helped

5 0
3 years ago
Read 2 more answers
Andy wants to change some of the components in his old computer system.he had recently upgraded the motherboard and he now wishe
ladessa [460]

Looking at the images and the boxes, it goes like this;


To add external functionality of external backup, you would probably have something removable from the computer accessable. This means that the Optical Drive would add functionality of external backup, and the first tile goes there.


A processor is what does the general computations inside a laptop/desktop computer and processes information as the name implies. Upgrading the processor makes it go faster. The second tile would go to the processor.


The third one need no further explanation and would go to the Hard Drive, but just keep in mind that the Hard Drive stores all the information on your computer (i.e. Applications, Photos, etc.).


Hope this helps!

6 0
3 years ago
Read 2 more answers
Other questions:
  • A slide ____ is a special effect used to progress from one slide to the next slide in a slide show.
    12·2 answers
  • What is the difference between primary storage,secondary storage and offline storage what type of storage can be
    6·2 answers
  • In short and brave what is technology?
    9·2 answers
  • When protecting a worksheet all cells are locked by default.?
    10·1 answer
  • Which of the following should get a Page Quality (PQ) rating of Low or Lowest?
    5·1 answer
  • Write a program that will find the smallest, largest, and average values in a collection of N numbers. Get the value of N before
    13·1 answer
  • These data provides the responses of 10 students in class A and in class B who were asked how many hours they slept lastThese da
    6·1 answer
  • I dunno what to write my memo thing about ⁻³⁻
    10·2 answers
  • Look at the picture lol
    6·2 answers
  • What report provides data on how specific sections of a website performed?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!