Question: Write an algorithm in c language: If a user inputs an integer value 1 or 2, the value of 1 is assigned to a variable

 Write an algorithm in c language: If a user inputs an

Write an algorithm in c language: If a user inputs an integer value 1 or 2, the value of 1 is assigned to a variable 'x' and variable 'y' is assigned value 0. But if the user inputs integer value 3 or greater, the value of variable 'y' is 1 and variable 'x' is 0. NOTE: do not use selection structures (else/if and switch cases are not allowed)

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!