Array problem!

I want to make an array to increase and decrease. From 0 to 500 and back.
And i don't know how...
Can you help?
Last edited on
I don't understand your question.

An array is just a group of variables. So what would you increase? The number of variables in the array? Or would you increase just a single variable in the array to a value of 500? And why would either of those be useful?
Either use standard container std::vector or dynamically allocate and reallocate memory for the array.
Can you git a number to go from 0 to 500 and back? If you can then how would i do that?
Here's one way.
1
2
3
4
5
for(int x=0;x<=500;x++)
cout << x << " ";
for(int x=500; x>=0;x--)
cout << x << " ";
cout << "We're done!!" << endl << end;
Thanks.
Topic archived. No new replies allowed.