Answer to Question #1345 in Action Script | Flash | Flex | ColdFusion for sam20111
2011-01-14T09:40:46-05:00
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 ?
1
2011-01-17T05:14:53-0500
#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 !
Learn more about our help with Assignments:
Adobe Flash
Comments
Leave a comment