Computer Science: A Structured Programming Approach Using C, Third Edition
Computer Science: A Structured Programming Approach Using C, Third Edition
3rd Edition
ISBN: 9780534491321
Author: Behrouz A. Forouzan, Richard F. Gilberg
Publisher: Course Technology, Inc.
Expert Solution & Answer
Book Icon
Chapter 3, Problem 23PS

a.

Explanation of Solution

Given: The values of the variables, x = 2, y = 3, and z = 1, are assigned to the expression, x+2 / 6+y.

To find: The result of the expression, x+2 / 6+y, if x = 2, y = 3, and z = 1 .

Solution:

Precedence of the operator defines the grouping of words within an expression and defines how to interpret an expression. Many operators precede over others; for example, the operator of multiplication has a greater precedence than the operator of addition...

b.

Explanation of Solution

Given: The values of the variables, x = 2, y = 3, and z = 1, are assigned to the expression, y-3 * z+2.

To find: The result of the expression, y-3 * z+2, if x = 2, y = 3, and z = 1 .

Solution:

Precedence of the operator defines the grouping of words within an expression and defines how to interpret an expression. Many operators precede over others; for example, the operator of multiplication has a greater precedence than the operator of addition...

c.

Explanation of Solution

Given: The values of the variables, x = 2, y = 3, and z = 1, are assigned to the expression, z – (x+z) % 2 + 4.

To find: The result of the expression, z – (x+z) % 2 + 4, if x = 2, y = 3, and z = 1 .

Solution:

Precedence of the operator defines the grouping of words within an expression and defines how to interpret an expression. Many operators precede over others; for example, the operator of multiplication has a greater precedence than the operator of addition...

d.

Explanation of Solution

Given: The values of the variables, x = 2, y = 3, and z = 1, are assigned to the expression, x-2*(3+z)+y.

To find: The result of the expression, x-2*(3+z)+y, if x = 2, y = 3, and z = 1 .

Solution:

Precedence of the operator defines the grouping of words within an expression and defines how to interpret an expression. Many operators precede over others; for example, the operator of multiplication has a greater precedence than the operator of addition...

e.

Explanation of Solution

Given: The values of the variables, x = 2, y = 3, and z = 1, are assigned to the expression, y++ + z-- + x++.

To find: The result of the expression, y++ + z-- + x++, if x = 2, y = 3, and z = 1 .

Solution:

Prefix operation like ‘++var’ or ‘--var', having property that the value is first incremented or decremented by 1, then it returns the value...

Blurred answer
Students have asked these similar questions
int main(){    if(var1>50) { num = 20.0  } else { if(var1>35)  ---- Line 7 { num= 35.0; } else if (var1<80) { num=60.0; } else  { num=40.0; }}   What should be the outcome of the condition in line 7 in order for the value of num to be equal to 60.0?
Assume that speed = 10 and miles = 5. What is the value of each of the following expressions? A. speed + 12 - miles * 2 B. speed + miles * 3 C. (speed + miles) * 3 D. speed + speed * miles + miles E. (10 - speed) + miles / miles
If originally x = 4, y = 0, and z = 2, which is the value of x, y and z after executing the following code? if ( z == 2) y = 1; else x = 3;

Chapter 3 Solutions

Computer Science: A Structured Programming Approach Using C, Third Edition

Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage