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
Advantages of practicing safety in the information communication technology laboratory​
Svetllana [295]
Information communication technology (ICT) is a crucial tool to support effective communication and decision-making under complex and uncertain environments of disasters by enhancing cognitive capacity of emergency managers. With the continuous influence and evolution of communication technologies, information sharing and decision-making has drastically changed and affects each phase of emergency management. Researchers continue to investigate the relationship of human involvement for spreading public safety information through ICT. With each disaster holding diverse characteristics influencing prediction, detection, and specific activities required for prevention, mitigation, response and recovery, the need for interoperable and dependable communication infrastructure, a common operating picture, and supportive regulations, policies, and practice greatly increases. Although a national public safety communication system was proposed, there are implementation challenges between local, state, and federal agencies. This paper briefly examines the evolution of the use of ICT for public safety along with current trends, benefits and challenges, and future needs.
4 0
3 years ago
What is the tool that is used to automatically search New information on the internet and organize if for future searches?
Karo-lina-s [1.5K]
The answer would be a "web crawler"
4 0
4 years ago
How would you create a loop that never ends?
34kurt

Answer:

the answer is d use the forever block

Explanation:

I took the test and I got it right but sometimes it is different for others

8 0
3 years ago
What is the disadvantages of using proprietary software
Snezhnost [94]

Answer:

Cost. One of the biggest drawbacks of any proprietary software is the licensing fee. ...

Developer Support. ...

Security Issues. ...

Customization.

Explanation:

5 0
3 years ago
Read 2 more answers
How many microprocessors will a small computer have
Arte-miy333 [17]
Well, most of the new Pc's today have dual-core central processors (CPU). They only have one chip with two complete microprocessors on it, both of them share one path to memory and peripherals. But if it's a high-end hardcore gaming Pc, you could have two processor chips with 4 microprocessors on each.
4 0
4 years ago
Read 2 more answers
Other questions:
  • The compare_strings function is supposed to compare just the alphanumeric content of two strings, ignoring upper vs lower case a
    15·1 answer
  • What was the first<br> 1:search engine<br> 2:website<br> 3:time the internet started
    6·1 answer
  • Write a Java program to print the result in the series 10, 15, 20, 25, ..., 50. Hint: You can use an iteration statement for wri
    9·1 answer
  • Create a stored procedure sp_Q1 that takes two country names like 'Japan' or 'USA' as two inputs and returns two independent set
    5·1 answer
  • Which remote assistance option requires peer name resolution protocol (pnr) and ipv6?
    5·1 answer
  • Which best explains what Grace did with the revisions?
    7·1 answer
  • In Python please:
    14·1 answer
  • Write a recursive method that returns the number of 1’s in the binary representation of N. Use the fact that this is equal to th
    9·1 answer
  • Escribe un ejemplo de:• Software de aplicación. • Software de diagnóstico. • Software de sistema. ayudenme plis, me toca entrega
    10·1 answer
  • what is invention and inovation do more responsible think for making computer a succsessful product?explain​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!