Write a program using two arrays and enter values in 1st array. The program should copy the values of the 1st array to 2nd array and display the 2nd array in the reverse order.
So let’s Write Code:
program using two arrays and enter values in 1st array. The program should copy the values of the 1st array to 2nd array.
#include<iostream.h>
using namespace std;
main()
{
int a[5], b[5], i;
for(i = 0; i<=4; i++)
{
cout<<"Enter value in element "<<i<<" of 1st array? ";
cin>>a[i];
b[i] = a[i];
}
for(i = 4; i>=0; i--)
cout<<"b["<<i<<"] ="<<b[i]<<endl;
}
Hope You will learn Something. Happy Coding.
Visit my YouTube Channel as Well๐ https://www.youtube.com/watch?v=JuIHQ9cLSEw&list=PLbIhkHxfUIItTdcyCb34uRIrPJbXBndIl&index=4
Click on the below Links for more Programming Exercises:
Conditional Structure Exercises: ๐https://myustaadg.com/category/programming-exercises/conditional-structures-exercises/
Array Exercises: ๐https://myustaadg.com/category/programming-exercises/arrays-exercises/