Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c++ Write a program to: 1. Declare an integer array a of size 10 2. Assign it values using the following formula: a[i] =

in c++

Write a program to:

1. Declare an integer array a of size 10

2. Assign it values using the following formula:

a[i] = i*2+1

Print the contents of array a.

3. Copy all elements divisible by 3 into another array (say b). Print array b.

4. Create a new array (say c) with the first half of c as the second half of a and the second half of c as

the first half of a. Print array c.

5. Create a new array(say d) that contains all elements of array a in reverse. Print array d.

Contents of each array must be printed on a new line and array elements in each line should be separated

by a space.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago