There's a line from (x1,y1) to (x2,y2) in a grid of squares of unit length. Write a program tocompute the number of squares which are intersected by the line internally, i.e squares which areonly touched by the line should not be counted.
x1,y1,x2,y2 are all integers.
0 <= x1,y1,x2,y2 <= 10000
Write the program so that it accepts 4 command line parameters - x1,y1,x2,y2
The output of the program should be a single line consisting of only the integer outputvalue.
Input (x1 y1 x2 y2):
1 1 6 6
Output (No. of squares):
1 1 7 6