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
Using filtering as a strategy to deal with information overload requires Group of answer choices reviewing all unsolicited infor
STALIN [3.7K]

Answer:

The answer is "Choice B"

Explanation:

Please find the complete question in the attached file.

A filter is a tool for removing undesirable parts. Eliminate solid from a fluid, for example. The filter may mean the filter action: it could be used as a verb. When the filter is mentioned, various branches of science and technology often refer to a certain type of device. Filtering tries to decide the data you need and the data you have to address the overload.

4 0
3 years ago
What does every formula in microsofte excel spreadsheet start with??
Sedbober [7]
Equal sign (=) 
hope so !!!

5 0
3 years ago
Read 2 more answers
What animal is perry the platypus ​
valkas [14]

Answer: Agent P or simply Perry

Explanation:

4 0
3 years ago
Read 2 more answers
As an experienced networking professional, you are asked to conduct a posture assessment on a local credit union’s network. The
ale4655 [162]

Answer:1987

Explanation:guess

8 0
4 years ago
Diseñe un algoritmo que le permita montar bicicleta y llevar en ella una carga desde la tienda hasta su casa.
Stella [2.4K]

Answer:

La fuerza se aplica en el lado opuesto de la carga.

Explicación:

Para andar en bicicleta y llevar una carga de la tienda a su casa, usamos tales reglas para llevar la carga de manera más fácil y segura. Si la carga es grande y está colgada en el mango derecho de la bicicleta, entonces la fuerza se aplica en el lado izquierdo de la bicicleta para mantener el equilibrio. Si no hicimos esto, la moto se irá hacia el lado derecho y el piloto sufrió el accidente.

6 0
3 years ago
Other questions:
  • Consider the following code:
    13·1 answer
  • Themes are applied from which tab?
    6·1 answer
  • Shortcuts will help you complete spreadsheet tasks more efficiently.
    12·1 answer
  • A type of wireless local area network technology​
    7·2 answers
  • What is netbeans and what is it for??
    9·1 answer
  • Tree diagrams are useful for
    12·1 answer
  • PLEASE HELP ASAP!!
    11·2 answers
  • Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the ga
    12·2 answers
  • One key feature of malware is that it:
    13·1 answer
  • Liam is at the park an would like to play soccer. He tell another kid at the park that he would hurt him if he couldn't play soc
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!