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
Travis sends Suri what purports to be a link to an e-birthday card, but when she clicks on the link, software is downloaded to h
12345 [234]

Answer:

Identity Theft

Explanation:

Identity theft is the act of someone who obtains details about someone else illegally.  This is done to find personal and financial information such  name, address,social security number, passwords, and credit card number, phone number, e-mail, etc. Then the hacker can use this information to control bank accounts, e-mails, computers, portray himself as you are, or sell information to someone else.

3 0
3 years ago
Which of the following is an example of how the healthcare industry uses computer programming? (5 points)
IgorC [24]
3-D prosthetics would most likely be the answer, also, don’t copy links it’s most likely not the answer anyways.
5 0
2 years ago
Why does it help to differentiate among self-esteem,self-image, and self value
joja [24]

Evaluation of one’s own worth is termed as self-esteem. Each person will take the defeat and pointed out mistake in different manner. One person may shout if somebody points out mistake and another may handle it with smile. Self-esteem plays the role here.

Self image is an imaginary of picture of how an individual is in their own perspective and how the same person in the view of other person’s perspective. This is one of the important traits of the people.

Self-value: Setting a value of one self, analyzing various situations and facts and stamping the seal as either “good” or “bad” is called self-value.

8 0
3 years ago
Read 2 more answers
Photographing during the midday can produce which of the following?
bija089 [108]

Answer:

great lighting

great emotion

great setting

great feeling

5 0
3 years ago
Why is it important for students to be able to easily spot when a source of information is suspicious?
Kisachek [45]

Answer:

i dont know but ok

Explanation:

3 0
3 years ago
Other questions:
  • Which principle of design is she following
    9·1 answer
  • What is unique about being an administrative professional in a government job?
    8·2 answers
  • What is the different between image processing and machine vision? Please explain with an example.
    11·1 answer
  • You can tell that the equals() method takes a ____ argument because parentheses are used in the method call.
    6·1 answer
  • Which of the following is NOT something you can specify in the bullets and numbering dialog box?
    8·1 answer
  • A(n) ________ is a special value that cannot be mistaken as a member of a list of data items and signals that there are no more
    9·1 answer
  • assume an int array, candy, stores the number of candy bars sold by a group of children wherecandy[j] is the number of candy bar
    7·2 answers
  • Which type of computer graphic can be blown up to a much larger size without getting distorted or losing quality?
    5·1 answer
  • Please help this is a coding assignment I need help! (use python)
    12·1 answer
  • Means storing,accessing information over the internet other than hard drive and your system
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!