subject

1)create a conditional expression that evaluates to string "negative" if userval is less than 0, and "positive" otherwise. example 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;

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:30, 341404143
Ted wants to go out to a neighborhood park and shoot pictures of dew drops on grass. he wants to get a low-level angle of the dew drops. which support equipment should ted use? a. mini tripod b. pistol grip c. monopod d. body mount
Answers: 2
image
Computers and Technology, 22.06.2019 10:30, icantspeakengles
Aconstruction company is creating a powerpoint presentation describing how they calculate costs during each construction step. they plan to email this presentation to clients. the individual clients will be watching the presentation slide show on their own personal computers. what is the most important formatting step the company should take to make the text readable and pleasing to the eye?
Answers: 2
image
Computers and Technology, 22.06.2019 23:30, lexirandall19
Define a function printfeetinchshort, with int parameters numfeet and numinches, that prints using ' and " shorthand. ex: printfeetinchshort(5, 8) prints: 5' 8"
Answers: 1
image
Computers and Technology, 23.06.2019 01:30, giannav57
How do you set up a slide show to play continuously, advancing through all the slides without requiring your interaction? a. click set up slide show, and then select the loop continuously until ‘esc' and show without narration options. b. click set up slide show, and then select the loop continuously until ‘esc' and use timings, if present options. c. click set up slide show, and then select the show presenter view and use timings, if present options. d. click set up slide show, and then select the show without animation and browsed at a kiosk (full screen) options.
Answers: 3
You know the right answer?
1)create a conditional expression that evaluates to string "negative" if userval is less than 0, and...

Questions in other subjects:

Konu
Arts, 24.11.2020 02:00
Konu
French, 24.11.2020 02:00
Konu
Mathematics, 24.11.2020 02:00
Konu
Mathematics, 24.11.2020 02:00
Konu
Mathematics, 24.11.2020 02:00