I'm doing an exercise from a book [First Course in C++].
This is what I got so far:Quote:
Write a program which reads 5 numbers into an array and prints out the value of each and every number which has a value less than 10.
:(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];
}
int count = MyArray[0] ;
for(i = ; i<5; i++){
if(MyArray[i]< 10)
cout << count ;
getch();
return 0;
}
}
I feel really bad asking for the solution but I cannot find a way
to print out the darn array elements with a value < 10.
If someone want to put me out my misery, please. Thanks