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
Best programming languages? So far I have only learned html.​
Volgvan

Answer:

it's all up to personal preference some different ones have upsides and downsides but it's more of what you feel is best

4 0
3 years ago
Suppose you are given a text file. Design a Python3 program to encrypt/decrypt that text file as follows:
Allushta [10]

Answer:

Explanation:

Please find attachment for the Python program

Download docx
7 0
3 years ago
It's the same drop-down answers for both.
tia_tia [17]

Answer:

First, medium: can see all the subject but maintain the focus in him

Second, close-up: To se the facial expressions and emotions

5 0
2 years ago
Create a base class named rectangle that contains lenght and width data members.
kumpel [21]

Answer:

class Rectangle:  

   

   def __init__(self, length, width):

       self.length = length

       self.width = width

       

   

   def area(self):

       area = self.length*self.width

       return area

   

   

class Box (Rectangle):

   

   def __init__(self, length, width, height):

       super().__init__(length, width)

       self.height = height

       

   def volume(self):

       volume = self.length * self.width * self.height

       return volume

   

   def area(self):

       area = 2*(self.length*self.width) + 2*(self.length*self.height) + 2*(self.width*self.height)

       return area

rec_1 = Rectangle(2,4)

box_1 = Box(2,2,6)

print(box_1.length)

print(box_1.area())

   

print(rec_1.length)

print(rec_1.area())

Explanation:

The programming language used is python.

class Rectangle

The class Rectangle is created with attributes length and width.

The class attributes are initialized using the __init__ constructor.

In the rectangle class, a method/function is declared to return the area of the rectangle.

class Box

This class is a child of rectangle and it inherits all its attributes and methods,

It has an additional attribute of depth and its constructor is used to initialize it.

The class contains a volume function, that returns the volume and an override function 'area()' that displaces the area from the parent class.

Finally, some instances of both classes are created.

4 0
3 years ago
Which of the following is the core communications protocol for the internet? telnet ftp tcp/ip ssl
inna [77]
Tcp/ip is the core communication protocol for the internet
4 0
3 years ago
Other questions:
  • Use search engines and websites to research the following WAN technologies to complete the table below:
    7·2 answers
  • How could you fact check a news report that you saw on television
    12·1 answer
  • The ____________________ packet-filtering firewall allows only a particular packet with a particular source, destination, and po
    10·1 answer
  • A smart phone is always a _____.<br> client<br> server<br> network<br> process
    10·1 answer
  • This diagram shows a number of computing devices connected to the Internet with each line representing a direct connection.
    11·1 answer
  • Which of the following JavaScript expressions is equivalent to the given HTML code? ​ a. Document.getelementbyId("menu1").menu=
    6·1 answer
  • Item 8 Item 8 Shelby Black runs a very successful hair salon in downtown Los Angeles. One of Shelby’s tasks is to input positive
    13·1 answer
  • What was original name<br> whoever answers first gets brainly crown
    9·1 answer
  • What year did the first hovercraft sail on water
    15·1 answer
  • The average American has 10 devices, ask for users average number of devices. Any number between 7 and 12 will print “you have a
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!