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
Whitepunk [10]
3 years ago
15

1)Create a conditional expression that evaluates to string "negative" if userVal is less than 0, and "positive" otherwise. Examp

le output when userVal = -9 for the below sample program:
-9 is negative.
#include
#include

int main(void) {
char condStr[50] = "";
int userVal = 0;

userVal = -9;

strcpy(condStr, /* Your solution goes here */);

printf("%d is %s.
", userVal, condStr);

return 0;
}

2)

Using a conditional expression, write a statement that increments numUsers if updateDirection is 1, otherwise decrements numUsers. Ex: if numUsers is 8 and updateDirection is 1, numUsers becomes 9; if updateDirection is 0, numUsers becomes 7. Hint: Start with "numUsers = ...".

#include

int main(void) {
int numUsers = 0;
int updateDirection = 0;

numUsers = 8;
updateDirection = 1;

/* Your solution goes here */

printf("New value is: %d
", numUsers);

return 0;
Computers and Technology
2 answers:
SSSSS [86.1K]3 years ago
7 0
1. userVal < 0 ? "negative" : "positive"

2. updateDirection == 1 ? numUsers++ : numUsers--;
Licemer1 [7]3 years ago
5 0

Answer:

1:

if userVal<0

cout <<" negative":

userVale >0

cout<<"positive":

2:

if

updateDirection ==1;

numUsers++;

cout<<"numUser"

else

numUser--;

cout<<"numUser";

You might be interested in
What laptop is the best for programming and hacking​
Archy [21]

Answer:

I would suggest an outdated laptop that can't be updated anymore because it is old and outdated.

Explanation:

If you hack on an old laptop it can't be traced back to you because the servers are shutdown.

3 0
3 years ago
Write a program that prints the number 1 through 10 using a while loop
vova2212 [387]
Which programming language are you working in?

Here is how you could achieve this in Python:

establish a counter, starting at 1.
While your counter is 10 or less, do two things:
print the counter,
and increase the counter by 1.

code:
counter = 1

while counter <= 10:
print(counter)
counter = counter + 1

Those last two lines should be indented.
7 0
4 years ago
Irene establishes a wireless connection between her laptop and smartphone for sharing files. She has created a LANWANPAN, which
stira [4]

Irene created a LAN , which generally uses Ethernet cables for communication.

<h3>What is LAN about?</h3>

The LAN ports are known to be employed to link computers that do not have Wi-Fi access and it is one that make use of an Ethernet cable.

Note that Irene created a LAN , which generally uses Ethernet cables for communication to access the internet.

Learn more about  wireless connection from

brainly.com/question/26956118

#SPJ1

3 0
2 years ago
I need help!!! i will make you a brainliest!!
Ber [7]

Answer:

What you have is correct

Explanation:

3 0
3 years ago
When operating your vessel with a vhf radio, what channel must you monitor?.
Vladimir [108]

Answer: <u>Channel 16</u>. If you hear a MAYDAY call, remain silent, listen, and write down information about the boat in distress.

Hope this helps!

4 0
2 years ago
Other questions:
  • A digital footprint is all of the information on-line about a person posted by that person or others, ____________. intentionall
    14·1 answer
  • an object or device outside the computer, that one would plug into a port to control the functions of a computer are?
    9·2 answers
  • Plagiarism occurs when writers
    14·2 answers
  • Why does someone put 'human' at the end of their social media profile as a summary or description? I've seen this a lot online n
    15·1 answer
  • Describe how data center storage applications drive the development of SAN technology.
    8·1 answer
  • The network architecture component that is a special LAN with a group of servers that enables electronic data exchange of betwee
    8·1 answer
  • Question 1
    10·1 answer
  • Your task is to implement a function replace_once(t, d), that takes a text t and a replacement dictionary d, and returns the res
    10·1 answer
  • If a switch needs to send information to other switches in the network it would send out a ___________.
    7·2 answers
  • In dos operating system ,write a command to delete the directory as well as the files of the directory ''world'' on drive E.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!