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
Write a program that displays, 10 numbers per line, all the numbers from 100 to 200 that are divisible by 5 or 6, but not both.
FromTheMoon [43]

Answer & Explanation:

To print 10 on a line and each number separated by space; you make the following modifications.

print(str(i)+" ",end=' ')

str(i)-> represents the actual number to be printed

" "-> puts a space after the number is printed

end = ' ' -> allows printing to continue on the same line

if(count == 10):

     print(' ')

The above line checks if count variable is 10;

If yes, a blank is printed which allows printing to start on a new line;

The modified code is as follows (Also, see attachment for proper indentation)

count = 0

for i in range(100,201):

     if(i%6 == 0 and i%5!=0) or (i%5 ==0 and i%6!=0):

           print(str(i)+" ",end=' ')

           count = count + 1

           if(count == 10):

                 print(' ')

                 count = 0

7 0
4 years ago
Portable computer, also known as laptop computer, weighing between 4 and 10 pounds is called a. Internet b. Scanner c. Printer d
quester [9]

Explanation:

portable computer also known as laptop computer weighting between 4 to 10 pounds is called a Notebook computer.

7 0
3 years ago
Suggest any complete anime......?​
strojnjashka [21]
Ummmm toradora? on netflix
6 0
2 years ago
Read 2 more answers
When an organization uses cloud computing, they do not have to buy and maintain expensive hardware. Group of answer choices True
pshichka [43]

Answer:

The answer is "False".

Explanation:

Cloud computing refers to files and services, that are processed to retrieved over all the computers, rather than on the hard disk of your machine. It's also known as a Net metaphor, which is a so-called local disc and device, whenever you store information on a disc or run programs.

  • It uses distributed tools to save software and other equipment costs in organizations.  
  • It is a pay structure of "utility", that uses expensive hardware, and maintains it, that's why the given statement is false.

4 0
3 years ago
Help plz plus 10 points :)
yan [13]

She should  customize her logo

7 0
3 years ago
Other questions:
  • Which three phrases describe a wireframe
    12·1 answer
  • Tool such as microsoft’s ____ are helping to bridge different platforms and programming languages.
    6·1 answer
  • Here are some instructions in English. Translate each of them into the Simple Machine language.
    12·1 answer
  • Whatis the restriction placed on the push operation for an array-based implementation of a stack?
    13·1 answer
  • Which vendor certification would you think is the most relevant in the field of IT security? Why?
    7·1 answer
  • Which line of code will only allow a non-decimal point to be stored in a variable? candyCost = float(input("How much is the cand
    10·2 answers
  • What types of storage can be used to access your data on another computer?
    10·2 answers
  • How do I convert years to days on Python. For example, if I were to enter 3 years it should output "You are 1095 days old".
    5·1 answer
  • What is the term that refers to an Internet marketing technique in which you pay for high search engine results by advertising o
    12·1 answer
  • So my computer has be clicking random things and opening things. It’s been happening for a few days and I want to know if it’s a
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!