-2
Good people are caught in a little problem here I will put the statement here: "In this problem you should read 15 values put them in 2 vectors as these values are even or odd. However, the size of each of the two vectors is 5 positions. Then, each time one of the two vectors fills in, you must print out the whole vector and use it again for the next numbers that are read. After reading, print the remaining contents on each of the two vectors, first printing the values of the odd vector. Each vector can be filled as many times as necessary." The final part of the vector reset to be filled and what’s complicating my code is so at the moment:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
int par[5];
int impar[5];
int n,i;
while(i==0){
par[i]=0;
impar[i]=0;
for(i=0;i<15;i++){
scanf("%d",&n);
if(n%2==0){
for(i=0;i<5;i++){
par[i]=n;
printf("par[%d] = %d\n",i,par[i]);
}
}else{
for(i=0;i<5;i++){
impar[i]=n;
printf("impar[%d] = %d\n",i,impar[i]);
}
}
}
}
return 0;
}
Calm, calm, you’re too advanced for this, my
– Lucas De Oliveira