How to copy an array with another array

#include<iostream>
#include<conio.h>
using namespace std;
int size=10;
int main()
{
int sum=0;
int A[size],B[size]; //two array of 10 same data type elements
cout<<"Enter 10 elements in array A : ";
for(int i=0;i<10;i++)
{
cin>>A[i];
}
for(int i=0;i<10;i++)
{
B[i]=A[i];              //copying in elements of arrya A in array B
}
cout<<"Array A = ";
for(int i=0;i<10;i++)
{
cout<<A[i]<<"  ";
}
cout<<"\nArray B = ";
for(int i=0;i<10;i++)
{
cout<<B[i]<<"  ";
}
getch();
}

Popular posts from this blog

Shutdown Pc

Ellipse using OpenGl

String Comparisons