0
How to include 3 numbers at the beginning of this vector without affecting the previous numbers?
I’m trying to do it this way:
int main()
{
int v[30];
int i,x;
for(i=0; i < 15; i++)
{
printf("Digite 15 numeros");
scanf("%d", &v[i]);
}
for(v[i+3] = v[i]; i < 18; i++)
{
printf("Digite Mais 3 Numeros");
scanf("%d", &v[i]);
}
for(i=0; i < 15; i++)
{
printf("%d\n", v[i+3]);
}
}
But when presenting he takes out the first 3 numbers and puts the 3 new numbers at the end.
Explain your use case better. If you already know right away that you need 18 items, just put the first 15 in position 3 on, and then the others at the beginning.
– bfavaretto
I’m trying to solve the vector exercises, which is asked to create a vector with 30 more numbers that includes only 15 and print them and then add 3 more numbers at the beginning of this vector
– Nuck