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
padilas [110]
3 years ago
15

Given the following snippet of code, answer the following two questions based on the code: typedef enum {Sun, Mon, Tue, Wed, Thu

, Fri, Sat} days; days x = Mon, y = Sat; while (x != y) { x++; } y++; printf("x = %d, y = %d", x, y); 1. What value will be printed for variable x? [ Select ] . 2. What value will be printed for variable y? [ Select ]
Computers and Technology
1 answer:
ANEK [815]3 years ago
7 0

Answer:

1) The value of x will be 6.

2) The value of y will be 7.

Explanation:

1) The value of x will be 6.  

The enum values are labeled by default from 1. This means that Sun = 1, Mon = 2, Tue = 3 and so on.  

So, x = Mon = 2 and y = Sat = 6  

x increases up to y = 6 in the while loop.  

and then y also increments by 1.  

2)So the value of y = 7.  

You will need actual printf("Sun") or printf("Mon") for printing the actual text for the enum.

You might be interested in
Assume the following representation for a floating point number 1 sign bit, 4 bits exponent, 3 bits for the significand, and a b
Andrew [12]

Answer:

Detailed answers given in the solution

Explanation:

a)

max exponent= 1111=15

in biased form =15-7=8

max significant=1111=(.9375)10

max value= 1.9375*28

b) min exp= 0000=0-7=-7(biased)

min value=1.0000*2(-7)

c) Addition : Suppose we want to add two floating point numbers, X and Y.

steps to add floating point numbers:

Make exponents of the two numbers to be the same (if not). We do this by rewriting .

Add the two mantissas of X and the Y together.

If the sum in the previous step does not have a single bit of value 1, left of the radix point, then adjust the radix point and exponent until it does.

Convert back to the one byte floating point representation.

d) Multiplication :

Suppose you want to multiply two floating point numbers, X and Y.

steps to multiply floating point numbers.

sum of the two exponents..

Multiply the mantissa of X to the mantissa of Y. Call this result m.

If m is does not have a single 1 left of the radix point, then adjust the radix point so it does, and adjust the exponent z to compensate.

Add the sign bits, mod 2, to get the sign of the resulting multiplication.

Convert back to the one byte floating point representation, truncating bits if needed.

6 0
3 years ago
Using e-mail has decreased the number of hand-written letters that people send to their friends and relatives. this is a ____ fu
k0ka [10]
Hello <span>Alexkalhor5415

</span>Answer: Using e-mail has made it easy, fast, and inexpensive for family members who live in different parts of the united states to keep in touch. this is a positive  function of e-mail.
Hope this helps-Chris
6 0
3 years ago
"the ____ criteria filter requires the records displayed to have the specified text string anywhere."
Debora [2.8K]

The contains criteria filter requires the records displayed to have the specified text string anywhere. Thecontains operator is used to perform case-sensitive matching regardless of location in strings.

The begins with criteria filter on the other hand requires the records displayed to start with the specified text string

3 0
3 years ago
Choose the correct color to complete the sentence.
Serga [27]

Answer:blue is the best color choice for a global audience.

3 0
3 years ago
Which is an appropriate strategy for using a workplace blog?
OLEGan [10]

Answer:

a

Explanation:

8 0
3 years ago
Other questions:
  • What can act as a buffer against unemployment
    11·1 answer
  • Is anyone really good at immerse 2 learn??
    9·1 answer
  • End user needs assessment is a formal procedure to analyze a user's computer needs; it involves a specific set of steps that are
    8·1 answer
  • What is a well-planned strategy that ensures the search and navigation functions are easy to use and user-friendly on a website?
    15·1 answer
  • Which of the following JavaScript expressions is equivalent to the given HTML code? ​ a. Document.getelementbyId("menu1").menu=
    6·1 answer
  • Reading for comprehension requires _____ reading?
    7·1 answer
  • What is application software? A computer language for accessing data in a database. A character string used to identify the loca
    10·1 answer
  • The advantages of the dynamo
    15·1 answer
  • A business needs to open at the right ___________ and the right ______________. Choose all correct answers.
    9·1 answer
  • Write a method that makes the input string of sentences ending with and
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!