Initial Basics – Geometry – Problem #8

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

Difficulty: Medium

Problem Statement

Write a C program that take three coordinates as input. Next, it checks if the triangle is acute-angled, right-angled, or obtuse-angled. Your code should do the following: - first compute the lengths of three sides of the triangle; - check whether the input satisfies the triangle inequality property, i.e., max side length is less than the sum of the other two sides; - do necessary checking and print the type of the triangle in the terminal. Sample input: Enter the three coordinates: (2, 4), (6, 9), (-2, 7) This is a valid/invalid triangle This is a XX (acute-angled/right-angled/obtuse-angled) triangle

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

Lab Problem Statement

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

Interactive C Compiler · Problem #8

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.