Answered step by step
Verified Expert Solution
Link Copied!

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...

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions

Question

Do social networks help spread misinformation.

Answered: 1 week ago

Question

5. Identify the logical fallacies, deceptive forms of reasoning

Answered: 1 week ago

Question

6. Choose an appropriate organizational strategy for your speech

Answered: 1 week ago