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
laiz [17]
3 years ago
7

Int a = 1; int b = 0; int c = -1; if ((b + 1) == a) { b++; c += b; } if (c == a) { a--; b = 4; }

Computers and Technology
1 answer:
dimulka [17.4K]3 years ago
8 0

Answer:

a = 1

b = 1

c = 0

Explanation:

Given

The above code segment

Required

The final values of a,\ b\ \&\ c

The following line declares and initializes the values of a, b and c

int a = 1;     int b = 0;     int c = -1;

So, we have:

a = 1; b =0; c = -1

Next, the following if condition is tested

if ((b + 1) == a)

b + 1 =0 +1

b + 1 = 1

And:

a = 1

So,

b + 1 = a = 1

Since the condition is true, the statements in the curly brace { } will be executed;

b++ \to b = b+1 \to b = 0 + 1 \to b = 1

So:

b = 1

c += b \to c = c+b \to c = -1 + 1 \to c = 0

So:

c = 0

Next, the following if condition is tested

c == a

c = 0 and a =1

So:

c \ne a

That means, the statements in its curly brace will not be executed.

So, the final values of a, b and c are:

a = 1

b = 1

c = 0

You might be interested in
What is the main reason that IT managers believe the future IT career model will be diamond-shaped, with few entry-level IT jobs
Valentin [98]
<span>In which career field, would the Computing Technology Industry Association's CompTIA A+ certification be useful?</span>
4 0
3 years ago
How are switches indirectly involved in ARP poisoning?
11Alexandr11 [23.1K]

Answer:

They

are indirectly involved in the attack because they do not verify the the MAC/IP address

association

Explanation:

PLEASE MARK ME AS BRAINLIEST

8 0
3 years ago
What keyboard combination can you use to open the windows tool context menu, which contains options such as power options and di
Shkiper50 [21]
Windows button and x
8 0
3 years ago
How to improve and create beautiful graphic
kaheart [24]

Answer:

Learn OpenGL and any graphics rendering program.

Explanation:

3 0
3 years ago
Real GDP is found by removing the effects of inflation. How is this done mathematically?
tia_tia [17]
<span>B. By dividing Real GDP by (100/100-inflation rate).</span>
3 0
3 years ago
Other questions:
  • James has been asked to build a low-profile computer for his friend to use as a home theater system. James needs to choose parts
    15·1 answer
  • The objective of an Enterprise Resource Planning (ERP) system is to create a customized software program that integrates the inf
    14·1 answer
  • Andrea needs to format the legend on her chart. She clicks on the chart to select it. Which of the
    13·1 answer
  • Should I download RAM on my computer?
    11·2 answers
  • Lifelong learning _____. is only important for professionals with advanced degrees can be formal or informal includes formal cla
    12·1 answer
  • Look at the following program and answer the question that follows it. 1 // This program displays my gross wages. 2 // I worked
    8·1 answer
  • 5.17 (Calculating Sales) An online retailer sells five products whose retail prices are as follows: Product 1, $2.98; product 2,
    9·1 answer
  • What will result if the following code is used in an HTML file? New Title
    13·2 answers
  • Darla is going to start writing the HTML code for a web page. What would she start with?
    11·1 answer
  • An opening inside the system unit in which you can install additional equipment can be known as
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!