Im not talking about the even numbers stored in array,,But im saying that the numbers which are stored on even index of array could be displayed?

Think before you speak. Thats exactly whats he talking about. Fir you need to know
how to generate even numbers such as {0,2,4...}. Then you can use those numbers as indices to your array.

Think before you speak. Thats exactly whats he talking about. Fir you need to know
how to generate even numbers such as {0,2,4...}. Then you can use those numbers as indices to your array.

If i use "if" condition so that if it is true for even numbers at the indices then it will print the value stored in them,otherwise not....will this work? or can i use pointers in some way?

If i use "if" condition so that if it is true for even numbers at the indices then it will print the value stored in them,otherwise not....will this work? or can i use pointers in some way?

Using if and modulo to determine even/odd is one of the 2 ways. You can use pointers, but you still need to generate the indexes by one of the 2 ways.

Are you familiar with the compound assignment operators, such as "x += y"? You don't always have to increment your index by 1 at the end of your loop. You can increment it by other values when appropriate.

#include <iostream>
using std::cout;
using std::endl;
using std::cin;
int main() {
cout << "This will show all even numbers from 0 to 10." << endl;
for (int i = 0; i <= 10; i += 2) {
cout << i << " ";
}
cin.get();
return 0;
}

Using if and modulo to determine even/odd is one of the 2 ways. You can use pointers, but you still need to generate the indexes by one of the 2 ways.

Are you familiar with the compound assignment operators, such as "x += y"? You don't always have to increment your index by 1 at the end of your loop. You can increment it by other values when appropriate.

#include <iostream>
using std::cout;
using std::endl;
using std::cin;
int main() {
cout << "This will show all even numbers from 0 to 10." << endl;
for (int i = 0; i <= 10; i += 2) {
cout << i << " ";
}
cin.get();
return 0;
}

Good man James helped me learn die roll board game programming in Java,
and I applied it on Ladders and Snakes. Made one in Java. Now I'm learning to do ...

hi
this is one of my assignment that I have to do. it is a triangle calculator. everything well with it but it just the calculation. when I run it, ...