On 2/15/07, muhammad shahid <[EMAIL PROTECTED]> wrote:
> MY problem(in the following program) is that i
> want to store the values of 1starray(int 1starray[15]) into the
> 2ndarray(2ndarray[15]) in the reverse order
> i.e., the value at " 1starray[0]" will be equal to at "2ndarray[15]" in
> other words values at reverse index of array.
> i am using turbo c 3.0.
Recommend you get a newer compiler, that one is very old... DevC++ and
VisualC++ Express are both free and much more modern.
> #include<iostream.h>
> #include<conio.h>
> void main()
int main()
> {
> clrscr();
> int 1starray[15];
> int 2ndarray[15];
> cout<<""Enter values?\n";
> for(int i=0;i<15;i++)
> {
> cin>>1starray[i];
> }
> HOW I DO NEXT \
Just do a reverse loop from 14 to 0 on the 1starrary (i = 14; i >=0,
i--), and put that value into the 2nd array using 14 - i to calculate
the index for 2nd array.
-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
If I were to divulge it, it would overturn the world."
-- Jelaleddin Rumi