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;
The adjacency matrix is the matrix that has nodes as rows and columns. The nodes if connected is stated as 1 or else 0. And the adjacency list representation is the list with nodes and connected nodes. The nodes that are not connected are not being listed. The diagram and list as well as matrix can be found in the attachment.