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
In the belt drive mechanism, what happens when the belt is crossed instead of open?
KengaRu [80]
They will spin in the opposite direction because the belts are twisted.
8 0
3 years ago
Give brainliest if you tell me the can tell me the most random thing
Scorpion4ik [409]

Mood

Explanation:

Because it gets changed by the time you are happy or sad. Same that while you are reading if you like your. mood gets good but if you dont find this ans satisfied your mood gets changed.

3 0
3 years ago
All data process by a computer must be in 1. binary form 2. Hexadecimal form 3. Duodecimal form 4. Unitary form?
avanturin [10]

Binary code I believe.

3 0
3 years ago
Read 2 more answers
Answer for a, b, and c
Darya [45]

The answer is a. im pretty positive but if im wrong super sorry

5 0
3 years ago
What is the purpose of the SMTP command "HELO"
sergij07 [2.7K]
If a client initiates the SMTP communication using an EHLO (Extended Hello) command instead of the HELO command some additional SMTP commands are often available. They are often referred to as Extended SMTP (ESMTP) commands or SMTP service extensions. Every server can have its own set of extended SMTP commands.
4 0
3 years ago
Other questions:
  • Paragraph: Read the following two e-mail messages. In three to five sentences, explain why E-mail B is the more appropriate work
    5·1 answer
  • Your new home has a vacuum system. what kind of computer is controlling it?
    5·1 answer
  • To execute a prepared SQL statement, you can use the _______ and execute methods of the PDOStatement object to set parameter val
    9·1 answer
  • Which ipv6 prefix will the typical enterprise network receive from the service provider?
    12·1 answer
  • Write the statements needed so that the variable secondWord is associated with the second word of the value of sentence . So, if
    13·1 answer
  • Choose a project with a relatively simple description (building a LAN, designing a web page, inventing a new communication devic
    6·1 answer
  • HELP I WILL MARK BRAINLIEST!!! I NEED ASAP!!!
    5·1 answer
  • 2.
    11·1 answer
  • Sustainable development is a goal towards which all human societies need to be moving. elaborate the statement in about 120 word
    9·1 answer
  • State four input device that are used for playing gaming programs​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!