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 5, Problem 19PS

a.

Explanation of Solution

Given: The expression, x + y < z + t.

To find: The value of the expression if x =-2, y = 5, z = 0, and t = -4.

Solution:

The expression is,

x + y < z + t

-2 + 5 < 0 + (-4)

3 < -4

0 (...

b.

Explanation of Solution

Given: The expression, x – 2 * y + y < z * 2 / 3.

To find: The value of the expression if x =-2, y = 5, z = 0, and t = -4.

Solution:

The given expression is,

x – 2 * y + y < z * 2 / 3

-2 – 2 * 5 + 5 < 0 * 2 / 3

-2 – 10 + 5 < 0 / 3

-2 – 10 + 5 < 0

- 12 + 5 < 0

-7 < 0

Substitute the values of x, y, z, and t in the given expression...

c.

Explanation of Solution

Given: The expression, 3 * y / 4 % 5 && y.

To find: The value of the expression if x =-2, y = 5, z = 0, and t = -4.

Solution:

The precedence of given operators, *, /, and %, is same, so it is computed from left to right.

3 * y / 4 % 5 && y

3 * 5 / 4 % 5 && 5

15 /4 % 5 &&...

d.

Explanation of Solution

Given: The expression, t || z < (y + 5) && y.

To find: The value of the expression if x =-2, y = 5, z = 0, and t = -4.

Solution:

The expression is,

t || z < (y + 5) && y

-4 || 0 < (5+ 5) && 5

-4 || 0 < 10 && 5

-4 || 0 < TRUE

TRUE || FALSE < TRUE

...

e.

Explanation of Solution

Given: The expression, !(4 + 5 * y >= z – 4) && (z – 2).

To find: The value of the expression if x =-2, y = 5, z = 0, and t = -4.

Solution:

The expression is,

!(4 + 5 * y >= z – 4) && (z – 2)

!(4 + 5 * 5 >= 0 – 4) && (0 – 2)

!( 4 + 25 >= 0 - 4) && -2

!( 29 >= - 4) && -2

...

Blurred answer
Students have asked these similar questions
?Which of the following assignment statements is not correct x = ++x; x++ = y + 2; x += ++y; X = x++ + 2;
Write a statement that assigns finalValue with the multiplication of userNum1 and userNum2. Ex: If userNum1 is 6 and userNum2 is 2, finalValue is 12.   let userNum1 = 6; // Code tested with values: 6 and 4let userNum2 = 2; // Code tested with values: 2 and -2 let finalValue = 0;
Evaluate the following expressions, assume the following declarations: int a=28; int b=4; int c=2; int z=0; z*=a/b-c; What is the value of z after expression is evaluated?

Chapter 5 Solutions

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

Ch. 5 - There are two different ways to implement a...Ch. 5 - Which of the following statements about switch...Ch. 5 - Which of the following statements about the...Ch. 5 - Prob. 14PSCh. 5 - Prob. 15PSCh. 5 - If x=0,y=5,z=5, what is the value of x, y, and z...Ch. 5 - If x=3,y=0,andz=4, what is the value of the...Ch. 5 - Simplify the following expressions by removing the...Ch. 5 - Prob. 19PSCh. 5 - If originally x=4,y=0,andz=2, what is the value of...Ch. 5 - If originally x=4,y=0,andz=2, what is the value of...Ch. 5 - If originally x=4,y=0,andz=2, what is the value of...Ch. 5 - If originally x=4,y=0,andz=2, what is the value of...Ch. 5 - If originally x=0,y=0,andz=1, what is the value of...Ch. 5 - If originally x=4,y=0,andz=2, what is the value of...Ch. 5 - If originally x=0,y=0,andz=1, what is the value of...Ch. 5 - If originally x=0,y=0,andz=1, what is the value of...Ch. 5 - If originally x=0,y=0,andz=1, what is the value of...Ch. 5 - If originally x=0,y=0,andz=1, what is the value of...Ch. 5 - If originally x=0,y=0,andz=1, what is the value of...Ch. 5 - If originally x=2,y=1,andz=1, what is the value of...Ch. 5 - If originally x=1,y=3,andz=0, what is the value of...Ch. 5 - Evaluate the value of the following expressions:...Ch. 5 - Evaluate the value of the following expressions:...Ch. 5 - Write an if statement that will assign the value 1...Ch. 5 - Prob. 36PSCh. 5 - Write the code to add 4 to an integer variable,...Ch. 5 - Prob. 38PSCh. 5 - Write the code to print either zero or not zero...Ch. 5 - If the variable divisor is not zero, divide the...Ch. 5 - Prob. 41PSCh. 5 - Rewrite the following code using one if statement:...Ch. 5 - Rewrite the following code fragment using one...Ch. 5 - Write a code fragment that tests the value of an...Ch. 5 - Prob. 45PSCh. 5 - Prob. 46PSCh. 5 - Write a function called smallest that, given three...Ch. 5 - Prob. 48PSCh. 5 - Write a function called month_of_year that, given...Ch. 5 - Write a function called parkingcharge that, given...Ch. 5 - Prob. 51PSCh. 5 - Complete the incremental implementation of Program...Ch. 5 - Write a program that determines a student's grade....Ch. 5 - Prob. 54PSCh. 5 - Given a point, a line from the point forms an...Ch. 5 - Prob. 56PSCh. 5 - Write a program that asks the user to enter the...Ch. 5 - Prob. 58PSCh. 5 - This program is a simple guessing game. The...Ch. 5 - Write a program that, given a person's birth date...Ch. 5 - Write a program that calculates the change due a...Ch. 5 - Write a menu-driven program that allows a user to...Ch. 5 - Write a program that tests a user-entered...Ch. 5 - Write a program to compute the real roots of a...
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning