Answer the question
In order to leave comments, you need to log in
How to find the number of positive elements in each row?
Given a 3 by 3 matrix filled with random numbers.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define M 3
#define N 3
int main() {
int a[N][M], i, j;
srand(time(NULL));
for (i=0; i<N; i++) {
for (j=0; j<M; j++) {
a[i][j] = rand() % 20 - 10;
printf("%4d", a[i][j]);
}
printf("\n");
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question