Commit 67bab93b by rallui

Upload New File

parent 522fa840
Showing with 118 additions and 0 deletions
#include <stdio.h>
#include <stdio.h>
#define n 4
#define m 4
int main(void)
{
int i, j;
int B[n][m]={
{-3,-3,5, 9},
{5,6,5, 8},
{11,3,6, 2},
{2,-4,5, 5}
};
while (i < n)
{
j = 0;
while(j < m)
{
printf("[%4d]", B[i][j]);
j++;
}
printf("\n");
i++;
}
float min[m];
for(i=0; i<n; i++)
{
for(j=0; j<m; j++)
{
if(i==j)
{
if(min[j] > B[i][j])
{
min[j] = B [i][j]; printf("Minimaalne element diagonaalis:[%d][%d] = %d",i, j, B[i][j]);
}
i = i+1;
}
}
printf("\n");
}
float max[m];
for(i=0; i<n; i++)
{
for(j=0; j<m; j++)
{
if(i==j)
{
if(max[j] < B[i][j])
{
max[j] = B [i][j]; printf("Maksimaalne element diagonaalis: [%d][%d] = %d", i, j, B[i][j]);
}
i = m + 1;
}
}
printf("\n");
}
float min2[m];
for(i=0; i<n; i++)
{
for(j=0; j<m; j++)
{
if(i+j==m+1)
{
if(min2[j] > B[i][j])
{
min2[j] = B [i][j]; printf("Minimaalne element diagonaalis: [%d][%d] = %d", i, j, B[i][j]);
}
i = m + 1;
}
}
printf("\n");
}
float max2[m];
for(i=0; i<n; i++)
{
for(j=0; j<m; j++)
{
if(i+j==m-1)
{
if(max2[j] < B[i][j])
{
max2[j] = B [i][j]; printf("Maksimaalne element diagonaalis: [%d][%d] = %d", i, j, B[i][j]);
}
i = m + 1;
}
}
}
printf("\n");
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment