I want to output odd number using arrays. I have this solution working, but for general knowledge, can I improve this code more. if I can't, is there another way to output numbers using one dimension arrrays
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
int odd[10];
int i;
int k;
k=0;
for (i=1;i<10;i=i+2)
{
odd[k]=i;
cout<<odd[k];
k++;
}
_getch();
return 0;
}