60 477
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #1345 in Action Script | Flash | Flex | ColdFusion for sam20111

Question #1345
Write a c++ program that reads 10 integers save them in an array called A , and then prints the square of the elements of the array A ?
Expert's answer
#include <iostream>
#include <cmath>

using namespace std;

int main(int argc, char **argv)
{
& int* A = new int[10];
& cout << "Please input 10 integers:" << endl;
& for(int i = 0; i < 10; i++)
& {
cin >> *(A + i);
& }
& cout << "Squares of the elements:" << endl;
& for(int i = 0; i < 10; i++)
& {
cout << pow(*(A + i), 2) << " ";
& }
& delete[] A;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions