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
Whats the flow in this code, and whats the risk that its creating and what can i do to fix it? (c language)
Advocard [28]

Answer:

The risk is a buffer overflow.

Explanation:

Whatever the user passes as a command line argument, will be copied into the buffer. If the user passes more than 499 characters, the end of the buffer will be overwritten.

To solve it, compare the string length of argv[1] to 500 before copying, or even better, start using the new strcpy_s( ) function.

6 0
3 years ago
A throw(...) statement is an alternative way to return from a function or method that indicates some kind of failure occurred.
WITCHER [35]

Answer:

a.True.

Explanation:

A throw statement is used to throw an exception from inside the method.Whenever the throw statement is encountered by the compiler and after that when it is executed the execution of the currently executing method is stopped and it returns back to caller.

There is also a keyword Throws which is used to tell the compiler that the method may throw one or more exceptions.

Hence we conclude that the answer is True.

6 0
4 years ago
Security attacks are classified as either passive or aggressive. True or false
kogti [31]

Answer:

false is the answer okkkkkkkkkkkkkkkk

3 0
3 years ago
Please explain external hashing, B-trees, and traversals. 3-5 sentences per
katrin [286]

Answer: In external hashing the hash table is in disk where each slot of the page table holds multiple entries which refers to pages on the disk organised in the form of buckets.

B-trees are self balancing trees which contains sorted data and allows insertion, deletion, traversals

Traversal is the process of visiting the nodes of the tree data structure.

Explanation:

External hashing is different from internal hashing and it refers to concepts in database management systems. Internal hashing stores only single record maintained in page table format, whereas external hashing holds multiple entries.

B-trees are generalisation of binary trees where it can have more than 2 children.

Traversal of trees helps in insertion, deletion, modification of nodes in tree data structure

4 0
4 years ago
✨Why is among us so addictive I try to play one game but end up playing over 20✨
lapo4ka [179]

Answer:

it is i got in troble for playing it so much lol

Explanation:

sorry for the spelling

5 0
3 years ago
Read 2 more answers
Other questions:
  • Powerpoint increased the weight of a line in ____ increments.
    13·1 answer
  • When a process becomes digital, it often becomes cheaper and the workflow becomes simpler. True False
    5·2 answers
  • A hub transmits all incoming messages to all of its ports except the port where the messages came in. A switch usually sends mes
    14·2 answers
  • The LPN/LVN cares for an older client admitted to the hospital for treatment of a fractured femur. The LPN/LVN notes the client
    10·2 answers
  • Consider a system consisting of m resources of the same type, being shared by n processes. Resources can be requested and releas
    9·1 answer
  • Imagine Frankie has a computer with a full hard drive. She needs to create and save a new document, so she deletes a bunch of ol
    8·1 answer
  • What are possible penalties if a designer is caught breaking copyright laws?
    13·1 answer
  • WILL GIVE BRAINLIEST
    11·2 answers
  • Anyone tell my answer.
    15·1 answer
  • What is one way to establish a team's velocity?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!