// Input a positive integer n from the user and then input n vectors of size 3. // The memory for storing these n vectors of size 3 must be allocated dynamically // and together. /*Now, compute the pairwise distance among these n vectors and store them in a nxn matrix. The memory for this matrix should also be stored dynamically*/ //Author: rahule@iitk.ac.in #include #include #include float dist(int x1,int x2,int x3,int y1,int y2,int y3); //calculates the distance between the points (x1,x2,x3, y1,y2,y3) int main() { int i,j,n,*a; float *d; printf("\nEnter the number of vectors :"); scanf("%d",&n); a=(int *)malloc(n*3*sizeof(int)); //allocating space to store the vectors.(imagine it as a a[n][3] arrray d=(float *)malloc(n*n*sizeof(float)); //allocating space to store the distance calculated.(nxn) for(i=0;i