This Program Take an array and copy that array into another array after reversing it
#include<iostream.h>
void main(){
int A[]={0,1,2,3,4,5,6,7,8,9,10};
int B[10];
cout<<"\n Array A is: ";
for(int i=0;i<=10;i++){
cout<<A[i]<<" ";}
for(int i1=0,j=10;i1<=10;i1++,j--)
{
B[j]=A[i1];
}
cout<<"\n Array B is: ";
for(int i2=0;i2<=10;i2++){
cout<<B[i2]<<" ";}
}
#include<iostream.h>
void main(){
int A[]={0,1,2,3,4,5,6,7,8,9,10};
int B[10];
cout<<"\n Array A is: ";
for(int i=0;i<=10;i++){
cout<<A[i]<<" ";}
for(int i1=0,j=10;i1<=10;i1++,j--)
{
B[j]=A[i1];
}
cout<<"\n Array B is: ";
for(int i2=0;i2<=10;i2++){
cout<<B[i2]<<" ";}
}
0 comments:
Post a Comment