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
Suppose that a local area network requires seven letters for user names.​ lower- and uppercase letters are considered the same.
Naddik [55]
<span>If a user name can have seven letters (with no distinction between upper and lower case), and if a letter can be repeated, then the maximum number of names is 26x26x26x26x26x26x26, or 8,031,810,176. That is, slightly more than eight billion names are possible.</span>
6 0
3 years ago
What are the 2 levels of formatting in a word document
goldfiish [28.3K]

Answer:

Paragraph Styles and character formatting (font, color, etc.)

7 0
2 years ago
Picture question please help me
cluponka [151]

Answer:

where is the picture?????

6 0
2 years ago
Read 2 more answers
Give five examples of top level domain​
coldgirl [10]

Answer:  .com — Commercial businesses.

.org — Organizations (generally charitable).

.net — Network organizations.

.gov — U.S. government agencies.

.mil — Military.

.edu — Educational facilities, like universities.

Explanation:

5 0
2 years ago
Read 2 more answers
A ____ firewall keeps a record of the state of a connection between an internal computer and an external device and then makes d
Yakvenalex [24]

Answer:

Stateful frame filtering

Explanation:

<h2><u>Fill in the blanks</u></h2>

A <u>Stateful frame filtering </u> keeps a record of the state of a connection between an internal computer and an external device and then makes decisions based on the connection as well as the conditions.

8 0
3 years ago
Other questions:
  • Liz will use a CD-R compact disk to write to more than once. Carlo will use a CD-RW compact disk to write to more than once. Who
    8·2 answers
  • What is gender bias?
    9·1 answer
  • What is the output of the following program?
    11·1 answer
  • What are the classifications of computer
    9·1 answer
  • Write a structured algorithm that prompts the
    9·1 answer
  • Do u have to divide or multiply this problem 5300 yd = mi
    9·1 answer
  • In order to preview an attachment in an e-mail, click the attachment in the ______
    8·1 answer
  • Write a function sumOfMultiples, that inputs two integers - seed and cap. The function should return the sum of all the multiple
    6·1 answer
  • When you add encryption to a powerpoint presentation what does it do
    14·1 answer
  • It is manadatory to include a banner marking at the top of the page to alert the user that cui is present.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!