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
The icons to insert footnotes and endnotes in a document are located in the _____ tab.
ad-work [718]

Answer:

Answer: Reference

Explanation:

4 0
3 years ago
What does a virus do to a computer? How can it be fixed?
miv72 [106K]
A virus can do many things from burn up your hard drive to just annoy you with ads. the best thing you can do if you think you have one is take it to a professional
4 0
3 years ago
From the Start screen (on Excel), you can
Alex
I think (a) is the answer because this is the screen that it should open when u use it

6 0
3 years ago
Read 2 more answers
Assume the variable sales references a float value. Write a statement that displays the value rounded to two decimal points.Assu
romanna [79]

Answer:

The statement is as follows:

print("{0:,.1f}".format(number))

Explanation:

Required

Statement to print 1234567.456 as 1,234,567.5

To do this, we make use of the format keyword, and we set the print format in the process.

To round up number to 1 decimal place, we use the following format:

"{0:,.1f}"

To include comma in the thousand place, we simply include a comma sign before the number of decimal place of the output; i.e. before 1

"{0:,.1f}"

So, the print statement is:

print("{0:,.1f}".format(number))

3 0
3 years ago
Which type of portfolio might a young investor who is not afraid of risk choose?
Keith_Richards [23]
i think it would be the investment with high risk and high return such as Stocks.When investing in stock, investor analyze whether a specific company will be doing well in the time of investment (which will increase the market price of the stock) and take a profit from it.
7 0
3 years ago
Other questions:
  • The _____ command icon looks like a small clipboard with a page attached.
    6·1 answer
  • Briefly describe "SoftwareEngineering Framework". Do provide examples and diagrams wherenecessary.
    15·1 answer
  • What must you do first in order to change the font type size and colour of a particular text
    13·2 answers
  • A label is any word that appears in a cell of a spreadsheet.<br> True<br> False
    5·2 answers
  • Availability is an essential part of ________ security, and user behavior analysis and application analysis provide the data nee
    14·1 answer
  • If a student passes off an author’s work as his or her own, the student has
    6·1 answer
  • You press the F9 key to convert an object to a symbol true or false​
    12·1 answer
  • takes the perspective that a program describes what the solution to a problem is, not how that problem is solved. Select one: a.
    5·1 answer
  • What happens if an email server cannot find a matching username or the mailbox is full
    14·2 answers
  • 1. Who was the first lady programmer?​
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!