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
A. True
vlada-n [284]
True <span>when an input file is opened, the read position is initially set to the first item in the file.</span>
8 0
3 years ago
What is a Windows feature that allows you to temporarily store text?
nata0808 [166]
This would be copy and paste.

When you select a text, you can use your keys CTRL and C to copy that same selected text. After this, you can use the paste feature by selecting CTRL and V. Doing this, your selected text will be copied and pasted to a certain location. 
3 0
3 years ago
How do you hack a iPhone, Like If you forgot your password and want to get back in your phone. What do you do?
s344n2d4d5 [400]

Answer:

fix it on itunes

Explanation:

or get a new one

6 0
3 years ago
Read 2 more answers
Optimal page replacement ______.A. is the page-replacement algorithm most often implementedB. is used mostly for comparison with
deff fn [24]

Answer:

A. Is the page-replacement algorithm most often implemented.

Explanation:

This algorithm is used when a page that is not present in memory is called, leading to the Operating System to replace one of the existing pages with the needed one. There are different replacing algorithms in order to decide which page will be replaced.

This algorithm is implemented to reduce the number of failures and provide a better funcionality and speed the process by discarding pages that won't be used for a long period of time.

8 0
3 years ago
Value: 3
Citrus2011 [14]

Answer:

B - A word is correctly spelled but is used incorrectly in a document

4 0
3 years ago
Other questions:
  • A power supply unit for a computer converts:
    7·1 answer
  • Help with this robotics hw pls
    5·1 answer
  • Making the data impossible to recover even by applying physical forensics methods is known as __________ of media.
    13·1 answer
  • ______ is a type of computer software that is installed into devices such as printers, print servers, and various types of commu
    5·1 answer
  • A _______ policy states that the company may access, monitor, intercept, block access, inspect, copy, disclose, use, destroy, or
    5·1 answer
  • Translate We get up at 8 o'clock into Spanish in the box below:​
    9·1 answer
  • Write a class called Date that represents a date consisting of a day, month, and year. A date object should have the following m
    10·1 answer
  • Which online article citation is correctly formatted according to MLA standards?
    15·2 answers
  • Any please answer this How much resistance is required to gen-erate 50 mA of current from a 5 volt bat-tery?
    5·1 answer
  • What is machine learning
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!