Distance Between Two Points
mediumQuestion 145A Point struct (int x, y) is defined. Read two points (four integers: x1 y1 x2 y2). Print the Manhattan distance between them: the sum of the absolute differences of the x and y values.
Example: points (1, 2) and (4, 6) give |4-1| + |6-2| = 3 + 4 = 7.
Expected output
7= newline. No newline after the last line.
Hints4 available
Sign in to use hintsTopics
Structs
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.