Example 14: Determine the Collinear Points

Learn how to determine if the given points are collinear or not.

Problem

Given three points, (x1, y1), (x2, y2), and (x3, y3), write a program to check if all three points fall on one straight line.

You need to print the output on the console in the following manner:

  • Collinear
  • Non Collinear

Get hands-on with 1400+ tech skills courses.