There are many bad use of printf/scanf calls, and many unused or uninitialised variables.
Code:
$ gcc -Wall -Wextra -O2 foo.c
foo.c: In function ‘main’:
foo.c:30:17: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘int (*)[30]’ [-Wformat=]
scanf("%d", &matrice[j]);
^
foo.c:40:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘int *’ [-Wformat=]
printf("element %d: %d\n", i + 1, matrice[j]);
^
foo.c:49:17: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
somma = somma + matrice[j];
^
foo.c:50:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int (*)[30]’ [-Wformat=]
printf("sum: %d", &matrice[j]);
^
foo.c:44:11: warning: unused variable ‘somma’ [-Wunused-variable]
int somma;
^
foo.c:80:7: warning: statement with no effect [-Wunused-value]
getc;
^
foo.c:12:7: warning: unused variable ‘vet’ [-Wunused-variable]
int vet;
^
foo.c:11:7: warning: unused variable ‘MAXn’ [-Wunused-variable]
int MAXn;
^
foo.c:19:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &selection);
^
foo.c:22:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
^
foo.c:30:11: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &matrice[j]);
^
foo.c:48:9: warning: ‘m’ may be used uninitialized in this function [-Wmaybe-uninitialized]
for (j = 1; i <= m; i++) {
^
foo.c:8:7: warning: ‘j’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int j;
^
foo.c:7:7: warning: ‘i’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int i;
^