Skip to content

MyUstaadG

Learn to Serve

  • Computer Science
    • Software
    • Computer Tips
    • Coding
      • Conditional Structures Exercises
      • Loops Exercises
      • Arrays Exercises
      • Python Exercises
    • Microsoft Office
      • MS Excel
      • MS Word
  • Videos
    • Funny Videos
    • Health and Fitness Videos
    • PUBG Videos
    • Technology Videos
  • News
  • Funny
  • Memes
  • Playwright Tutorials
  • Tutorials
  • Toggle search form

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.

Posted on February 5, 2022February 5, 2022 By myustaadg.com
Spread the love

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:

Introduction to C++ Programming | Download and Install Dev C++ Compiler
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/

Arrays Exercises, Programming Exercises Tags:array in programing, Array simple codes, Arrays, arrays C++ codes, arrays C++ programing exercises, arrays codes, Arrays exercises, Arrays full course, arrays in programing, program using two arrays and enter values in 1st array. The program should copy the values of the 1st array to 2nd array.

Post navigation

Previous Post: Write a program to enter the temperature of a week and determine the maximum temperature, minimum temperature and average temperature.
Next Post: Write a program that inputs real values into float type array. It reads the value of each element of float type array and assigns to int type array.

More Related Articles

Write a program which input age from user and display on the screen if he/she is of legal age or not | Python Programming Programming Exercises
Write a program to input an array of 10 elements from the user and count the number of odd numbers and display it. Arrays Exercises
Write a program that inputs ten values into an array. It finds out the average value of the array Arrays Exercises
Write a Program to Build a Simple Calculator in Java Write a Program to Make a Simple Calculator in Java Programming Language | Solved Programming Exercises Programming Exercises
Write a program that uses three arrays โ€˜Aโ€™, โ€˜Bโ€™, and โ€˜Cโ€™. It inputs integer values in array โ€˜Aโ€™. In second array โ€˜Bโ€™, it stores the squares of values of array โ€˜Aโ€™ and in third array โ€˜Cโ€™, it stores cubes of the values of โ€˜Aโ€™. Arrays Exercises
Write a program that initializes values in a table and searches for a value from it. If value is found, then it displays the value and its location. Arrays Exercises

Copyright © 2022 MyUstaadG.

Powered by PressBook Blog WordPress theme