Initial Basics – Geometry – Problem #15

IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive

Difficulty: Hard

Problem Statement

Write a C-program which takes three distinct points (in 2-D coordinates) as inputs and checks whether they form a triangle or straight line. If they form a triangle, it prints “Formed triangle” and prints its area. If they form a straight line, it prints “Formed Straight Line” and prints the length between two end points. If any pair of points are non-distinct, it prints coordinates of that point, and notifies “Non-distinct input point” and prints the length between two distinct points, if any. Provide results for the following coordinate points: (2,3), (4,5), (10,23) (1,2), (4,8), (9,18) (0,0), (1,3), (1,3)

Back to Lab Problems
Initial Basics/Geometry/Problem #15

Lab Problem Statement

Specifications & Problem DetailsIIT Kharagpur PDS Archive
Loading question...

Interactive C Compiler · Problem #15

WASM In-Browser

Runs directly on your machine · Zero remote server dependency

Compiler downloads on first Run (large, saved in your browser after that)
main.cCtrl + Enter to run
1
2
3
4
5
6
7
Input (stdin)given to scanf / cin
Output

Output appears here. Press Run to compile and execute.