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
¿Cuales son las empresas mas exitosas que aún usan hoja de cálculo? porfa es urgentee
dem82 [27]

Answer:excel

Explanation:

6 0
2 years ago
Write a method that takes a Regular Polygon as a parameter, sets its number of sides to a random integer between 10 and 20 inclu
Fantom [35]

Answer:

Answered below

Explanation:

//Program is written in Java programming language

Class RegularPolygon{

int sides = 0;

int length = 0;

}

public void randomize(RegularPolygon polygon){

int randomSides = (int) 10 + (Math.random() * 20);

double randomLength = 5 + (Math.random() * 11);

polygon.sides = randomSides;

polygon.length = randomLength;

}

8 0
2 years ago
A(n) __________ is a common list operation used in programming. Its purpose is to iterate through a list of items, one item at a
34kurt
Linear search

You implement this algorithm by iterating over each item, and checking if the item matches what you are searching for.

It is linear because it takes a linear amount of time to search for an item.
5 0
2 years ago
Which design principle will help me add an element of interest in my poster by avoiding confusion and monotony?
Rasek [7]

Answer:

You could add pictures to help convey the viewer, while capturing their attention. It will provide great interest as well.

Explanation:

Me being a viewer, I love to see pictures. They help explain the topic, while keeping my attention.

7 0
3 years ago
What is one effective way for employees to keep their skillsets current
iragen [17]
<span> Create a large personal network online</span>
4 0
3 years ago
Other questions:
  • A peripheral can be used to tell a computer to complete a specific task. True False
    15·1 answer
  • With ____ editing, Word automatically displays a Paste Options button near the pasted or moved text.
    14·1 answer
  • Which of the following statements is false?
    12·1 answer
  • Which of the following is generally nota desire today's workers? A. computer ability B willingness to learn C. teamwork skills D
    8·1 answer
  • I have this assignment due TONIGHT BEFORE 10PM! Please help. 50 points for whoever will help!! Here is the assignment.
    7·1 answer
  • A network technician is designing a network for a small company. The network technician needs to implement an email server and w
    7·1 answer
  • Technologies can offer safety and protection for people
    11·1 answer
  • Why when you are on wifi it keeps kicking you off is your class during online learning​
    15·2 answers
  • List the operating system you recommend, and write a sentence explaining why.
    8·1 answer
  • Which best describes how a supporting database will be structured?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!