Question: Write a C++ program that creates two one dimensional arrays A and B of size 10 elements each. The main program should get the input

Write a C++ program that creates two one dimensional arrays A and B of size 10 elements each. The main program should get the input in the array A from the user and initialize array B with values 0. Your program should calculate the square (number * number) of each element of array A and should store in the square value in corresponding positions (index) in the array B. In the end, the main program (main function) prints the calculated values of array B. Also display the values in array B which are divisible by 3 (if any). (PLO3, CLO3)

Sample Inputs:

Please enter values in array A:

2 8 3 4 10 5 9 3 2 1

Sample Outputs:

The values in Array B are:

4 64 9 16 100 25 81 9 4 1

Values in Array B which are divisible by 3:

9 81 9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!