Knowee
Questions
Features
Study Tools

Suppose a, b and c are integer variables that havebeen assigned the values a=8, b=3 and c=-5.Determine the value of each of the followingarithmetic expressions:§ 2*b+3*(a-c)§ a*b/c§ a*(b/c)§ (a*c)%b

Question

Suppose a, b and c are integer variables that havebeen assigned the values a=8, b=3 and c=-5.Determine the value of each of the followingarithmetic expressions:§ 2b+3(a-c)§ ab/c§ a(b/c)§ (a*c)%b

🧐 Not the exact question you are looking for?Go ask a question

Solution

  1. For the expression 2b+3(a-c): First, substitute the values of a, b, and c into the expression: 23 + 3(8 - (-5)) This simplifies to: 6 + 3*(8 + 5) Further simplification gives: 6 + 3*13 Finally, this simplifies to: 6 + 39 = 45

  2. For the expression ab/c: Substitute the values of a, b, and c into the expression: 83 / -5 This simplifies to: 24 / -5 The result is -4.8. However, since a, b, and c are integers, the division operation will perform integer division, which discards the remainder and only keeps the quotient. So, the final result is -4.

  3. For the expression a*(b/c): Substitute the values of a, b, and c into the expression: 8 * (3 / -5) Since 3 / -5 is -0.6 and we are dealing with integer division, this simplifies to 8 * 0 = 0.

  4. For the expression (ac)%b: Substitute the values of a, b, and c into the expression: (8-5) % 3 This simplifies to: -40 % 3 The modulus operation finds the remainder after division of one number by another. So, -40 divided by 3 is -13 remainder 2. Therefore, the result is 2.

This problem has been solved

Similar Questions

Evaluate the following expressions and get the value of a, b, c and d by hand.x = 10;y = 20;z = 30;a = x++ + 10;b = --x – x--;c = ++x - ++y - ++z;d = ++y * ++y;Write a C program

Evaluate each expression for the given values of the variables.; x = −3

Evaluate the expression when b = -8/9 and c = -3/8. Write your answer in simplest form. b + 1/3c

Read the information given below and answer the questions that follow.(x?y) = (x + y)/2(x&y) = (x2 - y2)(x$y) = (x - y)/2  Q 39.   Determine the value of (A $ B) & C, when A = 1, B = -1 and C = 2.  Ops:   A. -1    B. -3    C. 2    D. 1

Evaluating algebraic expressions. Find the value of each expression when a = 4, b = 5, and c = 6.(a)    (b)    (c)   (d)   (e)

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.