0
Why aren’t you showing the 15 numbers? And how to include 3 numbers at the beginning of this vector?
int main()
{
int v[30];
int i,x;
for(i=0; i < 15; i++)
{
printf("Digite 15 numeros");
scanf("%d", &v[i]);
}
printf("%d Os numeros escolhidos foram:", v[i]);
}
And how do you add 3 numbers at the beginning of this vector? , obg for the first answer
– Nuck
Just put the number in the index you want, like this: v[0] = 20; v[1] = 21; v[2] = 22;
– Leila
Oh understood now, you want to add three more numbers but keep the ones that were already? for this I believe that I have to shift the current numbers to other positions, type v[3] = v[0]; v[4] = v[1]; v[5] = v[2]; (but you have to do this for all elements of the vector, then you can do a for with v[i+3] = v[i];) then you can put new values in the first positions.
– Leila