Just Help Please :(
hi .. my name is Ahmed from Egypt i just have assignment on array and i never take this lesson and no one want help me so please i have just 3 Q :)
1- Using Array , take form user 10 numbers and cout how many postive number and negative number ?
2-Using Array , the program will ask user to enter numbers. The program will save only 10 even number in the array and then display them ?
3-Display the index of the max numbers in the array ?
Thanks
Appending question marks to your instructions doesn't make them questions.
Last edited on
For example the first assignment can be done in the way as below
1 2 3 4 5 6 7 8 9 10 11 12 13
|
const unsigned int N = 10;
unsigned int positive = 0, negative = 0;
for ( unsigned int i = 0; i < N; i++ )
{
int x;
std::cin >> x;
if ( 0 < x ) positive++;
else if ( x < 0 ) negative++;
}
std::cout << "There are " << positive << " positive numbers and "
<< negative << " negative numbers\n";
|
Last edited on
Thanks All ... i just can't get the Q number 2 ??! :(
Topic archived. No new replies allowed.