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
Mashutka [201]
4 years ago
6

Int var1 = 0b0001; int var2 = 0b1111; int results1 = var1 & var2; int results2 = var1 | var2; int results3 = var1 ^ var2; in

t printit = results1 + results2 + results3; what are the values for results1, results2, results3 and printit after executing the code?
Mathematics
1 answer:
Afina-wow [57]4 years ago
8 0
<span>Int var1 = 0b0001;
int var2 = 0b1111;
int results1 = var1 & var2;
int results2 = var1 | var2;
int results3 = var1 ^ var2;
int printit = results1 + results2 + results3;
 
what are the values for results1, results2, results3 and printit after executing the code?
notes:
1. faster responses will be obtained if your code is presented line by line (in a file) before posting.
2. please specify language, many languages use the same syntax but could have differences in interpretation
-------------------------------------------------------------------------------

Assuming Java as the language.  C is similar.
</span><span><span>& bitwise AND &
^ </span><span>bitwise exclusive OR
</span><span>| bitwise inclusive OR

So 
results1=var1&var2=0b0001&0b1111=0b0001
results2=var1|var2=0b0001&0b1111=0b1111
results3=var1^var2=0b0001&0b1111=0b1110
printit=results1+results2+results3=0b0001+0b1111+0b1110
=0b10000+0b1110
=0b11110   

Note: by default, int has 4 signed bytes, ranging from decimal -2147483648 to +2147483647
</span></span>
You might be interested in
If y varies directly as x and y = 8 when x = 4, what is the value of y when x = 16? a. 32 b. 16 c. 64 d. 28
ddd [48]

By finding the proportional relation between x and y, we will see that when x = 16, we have y = 32.

<h3>How to get the value of y when x = 16?</h3>

If y varies directly with x, then we can write the relation as:

y = k*x

Where k is the constant of proportionality.

First, we know that when x = 4, we have y = 8, replacing that we get:

8 = k*4

Solving for k, we get:

k = 8/4 = 2.

Then the relation between x and y is:

y = 2*x

When x = 16, we have:

y = 2*16 = 32

Then the correct option is a.

If you want to learn more about proportional relations:

brainly.com/question/12242745

#SPJ1

5 0
2 years ago
Solve the following inequality. <br> 2P-3&gt;P+6
MakcuM [25]
The answer is P>9 The number line (if needed is)

8 0
3 years ago
Read 2 more answers
The radius of a circle is 3 meters. What is the circle's circumference?<br> r=3 m<br> Use 3.14 for .
Sunny_sXe [5.5K]
The answer would be 18.84
7 0
3 years ago
HELP FASTTTTTTTTTTTTTTTTTTTTTTTTTT
Gala2k [10]

Answer:

8 feet below sea level

Step-by-step explanation:

because ur already below sea level

5 0
3 years ago
Read 2 more answers
Help 8th grade math pls ;-;
Sever21 [200]

Answer:

19.1 feet

Step-by-step explanation:

Length of the ladder = 20 feet

Distance from the ladder to the wall = 6 feet

Height of the ladder on the wall = x

x² + 6² = 20²

x² = 20² - 6²

x² = 364

x = 19.1 feet (Rounded to nearest tenth)

6 0
3 years ago
Other questions:
  • Help NEEDED asap if you dont know atleast comment
    12·1 answer
  • Tracy has a cell phone plan that provides 250 free minutes each month for a flat rate of $29. For any minutes over 250, Tracy is
    11·2 answers
  • The quotient below is shown without the decimal point. Use number sense to place the decimal point correctly. 370 ÷ 2.5 ÷ 1.6 =
    15·1 answer
  • Using the quadratic formula to solve x2 = 5 – x, what are the values of x?
    10·2 answers
  • Mary sells fruit with four of her friends. If the earnings are divided evenly, how
    12·1 answer
  • A cylinder is sliced horizontally, parallel
    6·1 answer
  • Ramon earns $1,725 each month and pays $53.70 on electricity. To the nearest tenth of a percent, what percent of Ramon's earning
    7·1 answer
  • Can anyone explain to me how to find a locus of any point
    11·1 answer
  • PLS HELP FOR BRAINLIEST
    13·1 answer
  • NEED ASAP NEED TO RURN IN FAST!!! WILL MARK *BRAINLIEST*
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!