How to find the biggest column of the matrix (higher of main diagonale)
Here is the draft of code that i desighned/ Of cause it has a several mistake. But would you be pleased to corect it a few to make it workable. My task is here to create the matrix, allocate the dinamic memory for it, and to find the biggest sum of the column elements that is located over main diagonale. So main points is correct memory allocation, and the sorting to the biggest sum of column higher than diagonale.
It should be look like that__
Code:
#include<iostream>
#include<conio.h>
#include<time.h>
int main()
{
int i,j,k, **mas[i][j];
printf("Enter matrix size\n");
scanf("%d", &k);
*mas[i][j]=new int [k*k]
if (p==NULL) {
printf("\n Allocation Error\n"};
exit (1);
for (i=0; i<k; i++)
{
scanf("%d",&mas[i][j]);
}
for (i=0; i<k; i++)
{
printf("%d",&mas[i][j]);
}
suma[j]=0;
for (j=0; j<k; j++)
{
for (i<j+1; i<k; i++)
{
suma[j]+=mas[i][j]
}
}
{
int temp = suma[j];
suma[j] = m[j+1];
suma[j+1] = temp;
}
}
printf ("%i",suma[j]);
getch();
return 0 ;
}