# Have my final tommarow, while reviewing I need a refresher on two things !

• 12-15-2002
Halo
Have my final tommarow, while reviewing I need a refresher on two things !
First things first I would like to thank everyone that has helped me throughout this semester, I got a A going into the final (I hope I got one going out :-) That out of the way here is the meat and potatos !

-How do I find the minimum and maximuim of any amount of numbers... a slice of code would help me dearly.

-How do I input information into an array, I think its
/code
array [3],[3] = x
x=10
code/

Whops and maybe there is another :-)
-I doubt if anyone will do this for my but here goes nothing... A Do While, For, While function that does prints every other number up to 10.

Thanks for the help guys !!!
• 12-15-2002
Codulation
It's really not that hard to find min/max. I'll give you some hints.

Finding min integer:
Say you have an int array, start looping through the array and assume the first munber is the minimum and save it into a variable. Then test that variable against each of the other elements of the array and if the current element is smaller than what's in your variable, then store that number in the variable. When you've finished looping through the array, you'll have the smallest number in the variable. Do the same for finding the largest.
Not to hard eh? :D

-Futura
• 12-15-2002
master5001
I'm not sure what you are asking on that first question. But here is a sample of the second.

Example
Code:

``` int array[3][3] = {0}; //init array to zero array[0][0] = 2;  //first index set to 2 array[2][2] = 2;  //last index set to 2```
Good luck.
• 12-16-2002
tegwin
Code:

```for(int x = 0; x <= 10; x = x + 2) {   cout << x << " "; }```
Code:

```int x = 0; while (x <= 10) {   cout << x << " ";   x = x + 2; }```
Code:

```int x = 0; do {   cout << x << " ";   x = x + 2; }while(x <= 10)```