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
Alisiya [41]
3 years ago
10

Create a conditional expression that evaluates to string "negative" if userVal is less than 0, and "non-negative" otherwise. Ex:

If userVal is -9, output is:
-9 is negative. PLEASE USE C++
Computers and Technology
1 answer:
Goryan [66]3 years ago
5 0

Answer:

PROGRAMMING APPROACH:

  • Define the necessary header file using namespace.
  • Define the main() method.
  • Declare variable inside the function().
  • Print result.

Explanation:

Required C++ Code:

#include<iostream>

#include<string>

using namespace std;

int main()

{

  string condStr;

  int userVal;

  cin>>userVal;

  condStr=(userVal<0)?("negative"):("non-negative");

  cout<<userVal<< " is "<< condStr <<"."<<endl;

}

OUTPUT:

-2

-2 is negative.

You might be interested in
What does a computer use to determine if an ip address of another computer is on the same network or a different network?
Radda [10]
It uses it's routing table. If the destination is on the same network, it transmits directly via the MAC address. If the destination is on another network, it transmits to whatever the table says for that network. For desktops it's usually a default address of the router on the computer's network.
6 0
3 years ago
The more powerful, 60 volt cables and the main power shut-off on an HEV are both colored orange. true or false
babunello [35]

Answer:

True

Explanation:

7 0
3 years ago
PLEASE HELP!!! THIS IS DUE TODAY! WILL MARK BRAINLIEST!
8090 [49]

Answer:

-be nice

-be respectfull

-dont bully

-if u see somthing say somethung

-dont use same password for everything

Explanation:

7 0
3 years ago
You are configuring NIC teaming on a server with two network adapters. You chose Switch Independent Mode. You now must choose be
zmey [24]

Answer:

The appropriate answer is "Active/Active mode".

Explanation:

  • Now just after the customers or clients respond to the traditional standards, the board is comprised the information rapport with the cloud service, which would be considered as Active mode.
  • The car glides primarily somewhere at a specified constantly controlled rate of the conductor. Currently entering the grounding connection boosts the flow of electrons further into the receiver as well as the transmitter.

Thus the above is the correct solution.

3 0
3 years ago
What is a socket?a. The combination of the source and destination IP address and source and destination Ethernet addressb. The c
Zepler [3.9K]

Answer:

the combination of a source IP address and port number or a destination IP address and port number

Explanation:

Socket is a combination of a source IP address and port number or a destination IP address and port number.

3 0
3 years ago
Other questions:
  • What to take for ptsd
    5·2 answers
  • Give a recursive algorithm for finding the sum of the<br> first n odd positive integers.
    8·1 answer
  • Wyjaśnij w kontekście bezpieczeństwa, dlaczego wykonanie przelewu bankowego nie w każdej sytuacji wymaga zastosowania kwalifikow
    12·1 answer
  • A ______ workstation is a network terminal that supports a full-featured user interface, but limits the printing or copying of d
    5·1 answer
  • What wireless channel should I use?
    10·2 answers
  • In popular usage and in the media, the term ________ often describes someone who breaks into a computer system without authoriza
    10·1 answer
  • write a function named list_total that accepts a list as an argument (assume the list contains integers) and returns the cumulat
    11·1 answer
  • Working with do-while loop
    9·1 answer
  • Which gases are carried by red blood cells? Select two options.<br> science question
    14·2 answers
  • How to combine multiple documents into one pdf.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!