Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Operators Homework... Operators Homework 1. Write a single C statement to accomplish each of the following tasks: a) Assign the sum of x and y
Operators Homework...
Operators Homework 1. Write a single C statement to accomplish each of the following tasks: a) Assign the sum of x and y to z and decrement the value of y by 1 after the calculation. b) Multiply num by 3 using the * = operator. c) Increment variable x by 1, then subtract it from variable value. d) Add variable x to variable total, then increment x by 1. 2. Show the output produced by Assume that i, j, k are int variables. a) i = 7; j = 2; printf("%d %d", i / j, i %i); b) i - 4; j - 3; printf("%d", (i + 10) % j); c) i = 7; j = 8; k = 9; printf("%d", (i + 10) $k / j); Show the output produced by each of the following program fragments. Assume that i, j, k are int variables. a) i - 4; 1 = ++i * 3 - 2; printf("%d %d", i, j); i = 3; - 3 - 2 + i++; printf("%d %d", i, j; i = 2; i = 5; printf("%d ", i++ printf("%d %d", i, - ++i); 1); 5. Supply parentheses to show how a C compiler would interpret each of the following expressions. a) a + b - c + d + e b) a / b c d 6. Give the values of i and j after each of the following expression statements has been executed. Assume that i has the value 1 initially and has the value a) i += 1; c) i tj / i; b) i--; d) i % ++1; 7. Use De Morgan's Laws to write equivalent expressions for each of the following: a)!( x = 3) b)! (== y) !! !( z != 2 ) c)!! ( - 3) && ( y > 7 ) ) d) !! (x > 2) 11 ( y
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started