Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1.Consider the following assignment statement in a C program, where x and y are

ID: 638279 • Letter: 1

Question

1.Consider the following assignment statement in a C program, where x and y are integer variables, and x
has been initialized to a valid integer value:
y = x + 1;
Is it always true that after the execution of this line of code, y is 1 larger than x? Try to prove or disprove this statement.

2. Use English prose to define the following sets. Be as succinct as possible in your definition.
a) Phone numbers in the United States, which have the format (123) 456-7890 or 123-456-7890.
b) Real numbers in a C program.

Explanation / Answer

1. No, Its not always true

because, If x is initialized to maximum value that int can take... i.e (2^32) - 1

now if line y = x + 1will execute, it will not increment.

so, the statement is not always true.

2. a)Allowed ranges: [2