Hi Hunter2,
>> getch(); //You may want this to be outside the loop.
>> return 0; //This definitely should be outside the loop.
Oops! sorry, I overlooked that.
>> You don't really need count, just print out MyArray[i] instead
>> of trying to print count.
Thanks for that. I got a bit confused with the value of the loop and the value of the array I guess
Here it is, simple... but working:
Code:
#include <iostream.h>
#include <conio.h>
int main()
{
int MyArray[5];
int i ;
cout << "Enter 5 numbers"<< endl;
for(i = 0; i<5; i++){
cin >> MyArray[i];
}
for(i = 0; i<5; i++){
if (MyArray[i] < 10)
cout << "The number with a value < 10 is: "
<< MyArray[i] << endl;
}
getch();
return 0;
}
This is what you meant, ok?
- fizz