Need help
Can anybody explain this to me how this change happens, i have written exam
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
#include<iostream>
void ChangetheContent(int Arr[], int Count)
{
for(int C=0; C<Count; C++)
Arr[C]= Arr[Count – C- 1];
}
void main()
{int A[]= {1, 2, 3}, B[] = {20, 30, 40, 50}, C[]= {100, 200};
ChangetheContent(A,3);
ChangetheContent(B,4);
ChangetheContent(C,2);
for(int L=0; L<3; L++) cout<<A[L]<<’#’;
cout<<endl;
for(int L=0; L<4; L++) cout<<B[L]<<’#’;
cout<<endl;
for(int L=0; L<2; L++) cout<<C[L]<<’#’;
cout<<endl;
}
|
Topic archived. No new replies allowed.