• :00Days
  • :00Hours
  • :00Mins
  • 00Seconds
A new era for learning is coming soonSign up for free
Log In Start studying!

Select your language

Suggested languages for you:
Answers without the blur. Sign up and see all textbooks for free! Illustration

Q42E

Expert-verified
Discrete Mathematics and its Applications
Found in: Page 16
Discrete Mathematics and its Applications

Discrete Mathematics and its Applications

Book edition 7th
Author(s) Kenneth H. Rosen
Pages 808 pages
ISBN 9780073383095

Answers without the blur.

Just sign up for free and you're in.

Illustration

Short Answer

What is the value of x after each of these statements is encountered in a computer program, if x = 1 before the statement is reached?

a) if x+2=3 then x=x+1 b) if (x+1=3)OR (2x+2=3) then x=x+1 c) if (2x+3=5)AND (3x+4=7) then x=x+1 d) if (x+1=2) XOR (x+2=3) then x=x+1e) if x < 2 thenx=x+1

a) x = 2

b) x = 1

c) x = 2

d) x = 1

e) x = 2

See the step by step solution

Step by Step Solution

Definition of Statement

Mathematical statement is a sentence that is either true or false.

Value of x in a)

We write given expression as,

x+2=3

Given that initially x = 1,

Therefore, substitute 1 for x in the below given equation,

x = x+1

= 1+1.

=2

Hence, x = 2.

Value of x in b)

We write given expression,

Given that x = 1,

x+1=1+1 3

2x+2=2+2 3

False or false gives false.

Hence, x = 1

Value of x in c)

We write given expression as,

Given that x = 1,

2x+3=2+3 =5

3x+4=3+4 =7

True and true gives true.

Hence, x = 2.

Value of x in d)

We write given expression,

Given that x = 1,

x+1=2

x+2=3

True Ex-Or True gives false.

Hence, x = 1

Value of x in e)

We write given expression,

Given that x = 1,

Here 1 < 2

Hence, x = 2.

Most popular questions for Math Textbooks

Icon

Want to see more solutions like these?

Sign up for free to discover our expert answers
Get Started - It’s free

Recommended explanations on Math Textbooks

94% of StudySmarter users get better grades.

Sign up for free
94% of StudySmarter users get better grades.