1 Try this:
#include <stdio.h>
void func(int a[][4], int num_rows)
{
int i, j, count_odd;
for(i = 0; i < num_rows; i++)
{
count_odd = 0;
for(j = 0; j < 4; j++)
{
if(abs(a[i][j]) % 2 == 1) ++count_odd;
}
printf("\nOdd numbers in row %d = %d\n", i + 1, count_odd);
}
}
int main()
{
int i, j, num_rows;
int a[20][4];
printf("How many rows (max 20) : ");
scanf("%d", &num_rows);
for(i = 0; i < num_rows; i++)
{
printf("\nEnter 4 integers for row %d\n", i + 1);
for(j = 0; j < 4; j++)
{
printf(" Column %d : ", j + 1);
scanf("%d", &a[i][j]);
}
}
func(a, num_rows);
return 0;
}