Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Write a C++ program to :

Declare an integer array a of size 10

Assign it values using the following formula:

 a[i] = i*2+1 

Print the contents of array a.

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

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.

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.

#include #include using namespace std;

int main() { //create array a //assign and print array a //create and print array b //create and print array c //create and print array d return 0; }

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

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions

Question

Describe Balor method and give the chemical reaction.

Answered: 1 week ago

Question

How to prepare washing soda from common salt?

Answered: 1 week ago

Question

Explain strong and weak atoms with examples.

Answered: 1 week ago

Question

Explain the alkaline nature of aqueous solution of making soda.

Answered: 1 week ago