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
6.1.5: weather codehs
irina [24]

Answer:

6.1.5: weather codehs is a Python code or program platform to find the weather.

Explanation:

<u>Python Program to find the weather of any place</u>:

# Python program to find current  

# weather details of any city  

# using openweathermap api  

# import required modules  

import requests, json  

# Enter your API key here  

api_key = "Your_API_Key"

# base_url variable to store url  

base_url = "http://api.openweathermap.org/data/2.5/weather?"

# Give city name  

city_name = input("Enter city name : ")  

# complete_url variable to store  

# complete url address  

complete_url = base_url + "appid=" + api_key + "&q=" + city_name  

# get method of requests module  

# return response object  

response = requests.get(complete_url)  

# json method of response object  

# convert json format data into  

# python format data  

x = response.json()  

# Now x contains list of nested dictionaries  

# Check the value of "cod" key is equal to  

# "404", means city is found otherwise,  

# city is not found  

if x["cod"] != "404":  

# store the value of "main"  

# key in variable y  

y = x["main"]  

# store the value corresponding  

# to the "temp" key of y  

current_temperature = y["temp"]  

# store the value corresponding  

# to the "pressure" key of y  

current_pressure = y["pressure"]  

# store the value corresponding  

# to the "humidity" key of y  

current_humidiy = y["humidity"]  

# store the value of "weather"  

# key in variable z  

z = x["weather"]  

# store the value corresponding  

# to the "description" key at  

# the 0th index of z  

weather_description = z[0]["description"]  

# print following values  

print(" Temperature (in kelvin unit) = " +

    str(current_temperature) +

 "\n atmospheric pressure (in hPa unit) = " +

    str(current_pressure) +

 "\n humidity (in percentage) = " +

    str(current_humidiy) +

 "\n description = " +

    str(weather_description))  

else:  

print(" City Not Found ")

CodeHS is a comprehensive teaching platform for helping schools teach computer science. The strategic Code HS is to engage all understudies to seriously affect what's to come. They accept that in the 21st century, coding is an essential ability, much the same as perusing and composing. That is the reason it is stated: Perused, Compose, Code. This is finished by giving incredible educational plan, instruments, and assets to instructors, understudies, and schools to execute top notch software engineering programs. They have a conviction that everybody ought to find the opportunity to get the hang of coding, and that it's an expertise that gives boundless innovative chance to understudies. They have a mean to help make software engineering instruction fun and open, and accept everybody are needing both incredible apparatuses just as an extraordinary network to get this going. This is done through their help for instructors, understudies and schools, with the assistance their committed group and stunning guides.

6 0
3 years ago
Which expense is a bank least likely to extend a line of credit for?
m_a_m_a [10]

The answer would be:

A flat-screen TV.

7 0
3 years ago
Read 2 more answers
1.) Florida has ____________ roads that are designated as part of the National Highway System.
salantis [7]
Answer to number two is b, 3 is b, those are the ones i know
3 0
3 years ago
What will be the output of “AAAAMMMMMHHHVV” using a file compression technique?
stiks02 [169]

I think AAAAMMMMMHHVVV

i think suppose to be 3 v's

3 0
3 years ago
Read 2 more answers
Why is it important to know much time you spend on task
crimeas [40]
The answer is a) <span>so you can provide enough time studying. </span>
8 0
3 years ago
Other questions:
  • What is an extrinsic value? A. something that is valuable in and of itself B. something that is valuable because it leads to ano
    12·1 answer
  • Press the _______ key to move to the next cell in a row.
    12·2 answers
  • Your browsing the Internet and realize your browser is not responding which of the following will allow you to immediately exit
    14·2 answers
  • Which command is used to combine two or more cells together into one cell?
    14·2 answers
  • What is the name of the program file that you can enter in the Windows search or Run box to execute Event Viewer? What process i
    12·1 answer
  • ________type of website is an interactive website kept constantly updated and relevant to the needs of its customers using a dat
    5·1 answer
  • For demultiplexing a UDP socket is identified by:_____.
    15·1 answer
  • Vpn stands for _____. very precise settings virtual private network virtual public network vice prestigious setup
    5·1 answer
  • How do you mark answers brainliest?<br> it looks like they changed it and now idk how to
    12·1 answer
  • What would be the effect if the register contained the following values 10011000
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!