Commit 3438300b by rallui

Upload New File

parent f2eaa3f3
Showing with 53 additions and 0 deletions
#include <stdio.h>
#include <stdio.h>
#define n 4
int main(void)
{
int i,j;
float arv=1;
int B[n][n] = {{-1,-2,9,3},{-2,-4,8,-2},{-5,-7,-8,4},{-2,-8,4,9}};
int loendur;
for (i = 0; i < n; i++)
{
for(j = 0; j < n; j++)
{
printf("[%d]", B[i][j]);
}
printf("\n");
}
i=1;
j=0;
while(i < n)
{
while(j<i)
{
if(B[i][j]<0)
{
arv= B[i][j]*arv;
printf("%f\n", arv);
loendur++;
}
j++;
}
i++;
j=0;
}
if(loendur ==0)
{
printf("Negatiivseid arve pole. \n");
}
else
{
printf("Negatiivsete arvude korrutis on %f.\n", arv);
}
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