-1
Do a subprogram that has as input and output parameters: the address of an integer vector and the number of elements of that vector. The subprogram must eliminate from the vector all values that are outside the range between 10 and 20, placing the values inside the vector and adjusting the number of vector elements
#include <stdio.h>
#include <stdlib.h>
int NrVector(int j);
int main(){
int j,vector[j],z=0,h;
printf("Introduza o nr de numeros que pretende introduzir:");
scanf("%d", &j) ;
h=j;
vector[z] = NrVector(j);
printf("%d", NrVector(j));
for(z=0;z<j;z++){if(10<=vector[z] && vector[z]<=20){
printf("{%d}", vector[z]);}
else{ h-=1;} }
printf("o nr de elementos: %d", h);
printf("\n");
system("pause");
exit(1);
}
int NrVector(int j){
int vector[j],i=0,z=0,valor;
for(i=0;i<j;i++){
printf("Introduza o nr:");
scanf("%d", &valor);
vector[i]=valor;}
}