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
An electric kettle has the resistance of 30ohms what will flow when it connected to a 240v supply... find also the power rating
SVEN [57.7K]

Answer:

Power = 1920 Watts or 1.92 Kilowatts

Explanation:

Given the following data;

Resistance = 30 Ohms

Voltage = 240 Volts

To find power rating of the kettle;

Mathematically, the power consumption of an electric device is given by the formula;

Power = voltage²/resistance

Substituting into the formula, we have;

Power = 240²/30

Power = 57600/30

Power = 1920 Watts or 1.92 Kilowatts

4 0
3 years ago
Uses computer resources from multiple locations to solve a common problem.
Lynna [10]

Answer:

Distributed Computing is used to solve common problem from multiple locations at different locations.

Explanation:

It is the architecture of processor, that is used to combine the different resources of computer from different domain to solve the common problem.

It allows us resource sharing such as hardware and software that are connected to the computer.

Examples

Following are the examples of Distributed computing.

  1. Telecommunication Network
  2. sensor network
  3. banking network

8 0
4 years ago
Which section is optional in a resume?
suter [353]

<em>Career Objectives </em>are pointless in a resume, Things like experience, Contact details, education and skills, help the company decide whether to take you or not, in accordance with their needs. They don't need to know why you want the job as opposed to how you could help them.

7 0
3 years ago
In DNS cache poisoning, valid packets exploit poorly configured DNS servers to inject false information to corrupt the servers'
myrzilka [38]

Answer: True

Explanation: Domain name system(DNS) is the kind of attack that exploits the functioning of the DNS .This process is also known as the DNS spoofing .The corrupted data is invoked in the cache database and thus creates spoof.

It creates diversion of the traffic from the actual servers to the fake servers and entering the exploited data in the cache database.Thus, the given statement is true.

4 0
3 years ago
Write the definition of a function named alternator that receives no parameters and returns true the first time it is invoked, r
Nataly [62]

Answer:

The solution code is written in C++

  1. bool STATUS = true;
  2. bool alternator ()
  3. {
  4.    if(STATUS){
  5.        STATUS = false;
  6.        return true;
  7.    }else{
  8.        STATUS = true;
  9.        return false;
  10.    }
  11. }

Explanation:

We need a global variable to track the status of true or false (Line 1).

Next, create the function alternator (Line 2) and then check if current status is true, set the status to false but return the previous status boolean value (Line 5-6). At the first time of function invocation, it will return true.

The else block will set the STATUS to true and return the false (Line 7-9).

3 0
3 years ago
Other questions:
  • A software process describes the interrelationship among the phases by expressing their order and frequency, but does not define
    14·1 answer
  • In ________ for final fields and methods the value is assignedlater but in ______ you assign the value during declaration.
    15·1 answer
  • Select two netiquette guidelines. In three to five sentences, explain why these guidelines make professional online communicatio
    15·2 answers
  • For each policy statement, select the best control to ensure Ken 7 Windows Limited fulfills the stated requirements and also pro
    6·1 answer
  • Write a C program to calculate and display the coordinates of midpoint - M of a linesegment between two given points - say A and
    7·1 answer
  • The homepage is the page your browser displays when you first start the program
    12·1 answer
  • Exercise 3.6.9: 24 vs. "24"5 points
    7·1 answer
  • The BaseballPlayer class stores the number of hits and the number of at-bats a player has. You will complete this class by writi
    13·1 answer
  • Mention how to install antivirus software in your computer, either by following the instructions given on installation CDs or we
    6·1 answer
  • Once the reaction time experiment in your MakeCode micro:bit program is
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!