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
The ________ utility automatically creates duplicates of your libraries, desktops, contacts, and favorites to another storage lo
olga55 [171]

Answer:

The correct answer for the given question is option(A) i.e File History.

Explanation:

In computer system file history is an backup application which create backup of your data which are stored in your libraries, desktops, contacts, and favorites to another storage location .It creates back up of your data  to another location when your personal files has been changed.

The user can check the file history option in computer system

open control panel >>system and security >> file system

7 0
3 years ago
Draw a flowchart that solve the problem of calculating the average of 5 numbers.
KatRina [158]

Answer:

Draw a flowchart that solve the problem of calculating the Area of circle

Pie x r x2

Explanation:

3 0
2 years ago
How could the following line of code be shortened?
Alinara [238K]

Answer:

2

Explanation:

The second option is the only one that will work. The last would work but doesn't make the code any shorter.

8 0
2 years ago
In the Stop-and-Wait flow-control protocol, what best describes the sender’s (S) and receiver’s (R) respective window sizes?
kolbaska11 [484]

Answer:

The answer is "For the stop and wait the value of S and R is equal to 1".

Explanation:

  • As we know that, the SR protocol is also known as the automatic repeat request (ARQ), this process allows the sender to sends a series of frames with window size, without waiting for the particular ACK of the recipient including with Go-Back-N ARQ.  
  • This process is  mainly used in the data link layer, which uses the sliding window method for the reliable provisioning of data frames, that's why for the SR protocol the value of S =R and S> 1.
3 0
3 years ago
Which options are available in the Conditional Formatting dialog box? Check all that apply.
IrinaVladis [17]

Answer:

There are several options within this dialog box for applying Conditional Formatting ☼ Click the desired option under the Select a Rule Type list. ☼ The bottom portion of the dialog box will change depending on the Rule Type that was selected. ✞ Click Format Only Cells That Contain under Select a Rule Type

6 0
3 years ago
Read 2 more answers
Other questions:
  • Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outpu
    9·1 answer
  • Search engines that search other search engines are called
    12·2 answers
  • All of the following are vertical alignment options except __middle , top, center, or_bottom_.
    12·1 answer
  • Interest accumulated on the principle of a loan must also be paid. The accumulated interest is known as which of the following?
    7·1 answer
  • What data discovery process, whereby objects are categorized into predetermined groups, is used in text mining?
    9·1 answer
  • Universal Containers uses a custom object within the product development team. Product development, executives, and System Admin
    11·1 answer
  • Communication media that use an antenna for transmitting data through air or water are called _____.
    14·1 answer
  • Which of the following techniques can you not use to make the members of the std namespace available to your code? a. Code a usi
    11·1 answer
  • Margie has found a stock template to use. She changes a few things about the formatting and then saves the
    7·2 answers
  • Help fast fast anyone
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!