Sorting and 2d Arrays – Geometry – Problem #5

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

Difficulty: hard

Problem Statement

A three dimensional vector can be represented as a 1-D array containing three floating point values. Write a program which inputs a positive integer n from the user and then input n three dimensional vectors. The memory for storing these n vectors must be allocated dynamically. Now, compute the pairwise distance among these n vectors and store them in a n x n matrix. The memory for this matrix should also be allocated dynamically. Use can use the sqrt function in math.h

Back to Lab Problems
Sorting and 2d Arrays/Geometry/Problem #5

Lab Problem Statement

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

Interactive C Compiler · Problem #5

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.