Commit d940f210 by sameis

Array1

parent 8781be09
Showing with 28 additions and 0 deletions
#include <stdio.h>
#define n 4
#define m 4
int main(void) {
int i, j;
float korrutis = 1;
int B[n][m] = {
{-1, 2, -7, -9},
{4, -5, -2, -6},
{9, 2, 8, 2},
{2, 3, -3, 1}
};
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
if ((i < j) && (B[i][j] < 0)) {
korrutis = B[i][j] * korrutis;
}
}
}
printf("Peadiagonaali kohal olevate arvude korrutis on: %f\n", korrutis);
return 0;
}
\ No newline at end of file
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