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;
C = M0(M1+M2+M3)+M1(M2+M3)+M2M3 is the equation which suits
Explanation:
From the given data we can state that we need to activate only one product i.e 1------>activated 0-------->means inactivated and also only one slot is activated at a time.The resultant will be no data inputs n control bits and 2 to the power n output bits.