Giving input to a c++ file

My C++ program creates a nxn matrix with given value. For e.g if the input is 10 it will creates a matrix of 10x10 now what i want is the script should run program and give input values in a variation of 1000. Say first matrix of 1000 then 2000 , 3000 ..... 10000. I tried using for loop but unable to get the correct result. Also the executable is a.out.How should i create a script of this sort
Kindly help...

Have the C++ program read from stdin. ie., cin
One way to do it:

for i in 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000
do
      echo "$i" | myprogram
done 

Thanks it's running fine but it's not displaying the value of i.
it's displaying the value of i when echo "$i" is written but nothing is being
displayed when echo "$i"|program is written how to display and pass the value at the sametime