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
What are the 3 attributes of information?
Anton [14]

As previously said, the three highly important qualities of validity, accuracy, and completeness can be expanded into the information quality of integrity.

For information to be valuable and to meet the definition of information, it must largely have the characteristics of relevance, availability, and timeliness. Accuracy, completeness, consistency, distinctiveness, and timeliness are five qualities of high-quality information. For information to be accurate and valuable, it must be of high quality. Standard attributes, commonly referred to as global attributes, work with a wide variety of elements. The essential attributes such as accesskey, class, contenteditable, contextmenu, data, dir, hidden, id, lang, style, tabindex, and title are included in them.

Learn more about information here-

brainly.com/question/5042768

#SPJ4

4 0
1 year ago
Using the College Registration example from Section 6.7.3 as a starting point, do the following:
andreev551 [17]

Answer:

Check the explanation

Explanation:

INCLUDE Irvine32.inc

TRUE = 1

FALSE = 0

.data

gradeAverage WORD ?

credits WORD ?

oKToRegister BYTE ?

str1 BYTE "Error: Credits must be between 1 and 30" , 0dh,0ah,0

main PROC

call CheckRegs

exit

main ENDP

CheckRegs PROC

push edx

mov OkToRegister,FALSE

; Check credits for valid range 1-30

cmp credits,1 ; credits < 1?

jb E1

cmp credits,30 ; credits > 30?

ja E1

jmp L1 ; credits are ok

; Display error message: credits out of range

E1:

mov edx,OFFSET str1

call WriteString

jmp L4

L1:

cmp gradeAverage,350 ; if gradeAverage > 350

jna L2

mov OkToRegister,TRUE ; OkToRegister = TRUE

jmp L4

L2:

cmp gradeAverage,250 ; elseif gradeAverage > 250

jna L3

cmp credits,16 ; && credits <= 16

jnbe L3

mov OkToRegister,TRUE ; OKToRegister = TRUE

jmp L4

L3:

cmp credits,12 ; elseif credits <= 12

ja L4

mov OkToRegister,TRUE ; OKToRegister = TRUE

L4:

pop edx ; endif

ret

CheckRegs ENDP

END main

3 0
3 years ago
Which option for creating a table involves the use of a grid of squares?
SSSSS [86.1K]
It’s draw table iirc
4 0
3 years ago
Read 2 more answers
When you are making multiples of a brownie recipe, you cannot - without great difficulty - use a fraction of an egg. The calcula
Lera25 [3.4K]
The answer is one ☝️ question for the poll of a vote
5 0
2 years ago
A network administrator is implementing a ping from one end of the network to the other, records the average round-trip time and
alexira [117]
May be a Network diagram.
3 0
3 years ago
Other questions:
  • wHAT ARE THE 5 LAYERS in the internet protocol stack andwhat are the principal responsibilities of eack of theselayers.?
    12·1 answer
  • An investor is considering in which of two start-up companies to invest. The investor has faith in the industrial organization (
    9·2 answers
  • _______ is a form of crime that targets a computer system to acquire information stored on that computer system, to control the
    15·1 answer
  • When using a presentation software you can change the size of the text to...? Increase Font size, Decrease font size, increase t
    15·2 answers
  • An important communication principle states ""prepare before you communicate."" How should this preparation manifest itself in t
    10·1 answer
  • Very Short Answer Type Question (any 9)
    12·1 answer
  • Date
    6·1 answer
  • Please answer me <br> in Assignment - Algorithms
    10·1 answer
  • What was the name of the first personal computer and what year was it introduced
    7·1 answer
  • Find the mean median mode and range of the data set <br> 11, 13,11,12 10 ,12,11,8
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!