Question: Q3.(10 points) Write an if statement that adds 1 to x if x is negative and subtracts 1 from x if x is positive but

 Q3.(10 points) Write an if statement that adds 1 to x

Q3.(10 points) Write an if statement that adds 1 to x if x is negative and subtracts 1 from x if x is positive but sets x to 1 if x is 0 . Assume x is a predefined and initialized integer

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!