Răspuns:
#include <stdio.h>
int main()
{
int matrice[][3] = {
{-1, 0, 3},
{3, -4, 5},
{-2, -1, 0}};
int numarLinii = 3, numarColoane = 3, produsNumere = 1, contorNrNegative = 0;
for (int i = 0; i < numarLinii; i++)
for (int j = 0; j < numarColoane; j++)
if (matrice[i][j] != 0)
produsNumere *= matrice[i][j];
printf("Produsul numerelor nenule din matrice >> %d\n", produsNumere);
for (int i = 0, j = 0; i < numarLinii; i++, j++)
if (matrice[i][j] < 0)
contorNrNegative++;
printf("Nr. de numere negative de pe diagonala principala >> %d\n", contorNrNegative);
return 0;
}