Question: c language only 4. Write a C program that reads the first letter of direction (North, South, East, West), current (x,y) coordinate, and advancement of
c language only
4. Write a C program that reads the first letter of direction (North, South, East, West), current (x,y) coordinate, and advancement of a person and prints the new coordinate. For e.g., if the current coordinate of a person in X Y plane is (2,3) and s/ he advances 6 units towards North, then his/her new coordinate is (2,3+6)=(2,9). Sample input/output (bold ones are user inputs): Enter current coordinate ( x and y positions): 23 Enter No. units towards direction: 6 Enter Direction: N New coordinate: (2,9) 5. Solve question\#4 using switch-case
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
