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]
3 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]3 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
Is 6/11 greater than 9/14
4vir4ik [10]
No because when you cross multiply 9/24 has a bigger number
3 0
3 years ago
Bilal's favorite colors are red and green.
Arte-miy333 [17]

Answer:

P(A∪B) = 1/3

Step-by-step explanation:

Red  Garments = 1 red shirt + 1 red hat  + 1 red pairs of pants

Total Red Garments = 3

Green Garments =  1 green shirt + 1 green scarf + 1 green pairs of pants

Total Green Garments = 3

The total number of garments =  Total Red Garments + Total Green Garments:

3 + 3 = 6

Let A be the event that he selects a green garment

P(A) = Number of required outcomes/Total number of possible outcomes

P(A) =  3/6

Let B be the  event that he chooses a scarf

P(B) = 1/6

The objective here is to determine P(A or B) = P(A∪B)

Using the  probability set notation theory:

P(A∪B) = P(A) + P(B) - P(A∩B)

P(A∩B) = Probability that a green pair of pant is chosen = P(A) - P(B)

= 3/6-1/6

= 2/6

P(A∪B) = 1/2 + 1/6 - 2/6

P(A∪B) = 2/6

P(A∪B) = 1/3

8 0
3 years ago
Read 2 more answers
At the parents evening the ratio of mums to dads was 3:2. Out of 500 appointments how many were with mums?
guajiro [1.7K]

Answer:

300

Step-by-step explanation:

Sum the parts of the ratio : 3 + 2 = 5 parts

Divide the number of appointments by 5 to find the value of one part of the ratio, that is

\frac{500}{5} = 100 ← value of 1 part of the ratio

The mums consisted of 3 parts, hence

3 × 100 = 300 ← appointments with mums

3 0
3 years ago
Work out the value of 5x8 x 5-2/5x4
Alisiya [41]

Answer:

=6

Step-by-step explanation:

(5×8)×(5-2)/(5×4)

Numerator =40×3

=120

Denominator = 5×4

=20

simplifying 120/20

=6

5 0
3 years ago
Read 2 more answers
What is the slope of the line shown?<br> Answers <br> A: 3<br> B:2<br> C:1/2<br> D:-3
satela [25.4K]

Answer:

-3

Step-by-step explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • What do you put as an answer if two numbers have no GCF? 1 or 0
    8·1 answer
  • Please help!
    13·2 answers
  • How many quarts of water must be added to 3 gallons of soup that is 60% chicken broth to make the soup 40% chicken broth
    11·1 answer
  • Please help me answer this
    6·1 answer
  • Use the quadratic formula to determine the exact solutions to the equation.<br><br> 2x²−5x+1=0
    9·1 answer
  • Pls help me I’ll make u brainly
    7·1 answer
  • Which figures are reflections of Figure A?
    6·2 answers
  • Pretend we all live in the same house in the comments <br> Funniest gets brainliest.
    10·1 answer
  • What is 5 + 10 pls pls pls pls pls help
    13·1 answer
  • The selling price of a refrigerator, is $739.20. If the mark up is 20% of the dealers cost , what is the dealers cost of the ref
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!