Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

need help writing a c++ program thanks C++ Program. Write a C++ program that wil

ID: 3762673 • Letter: N

Question

need help writing a c++ program

thanks

C++ Program. Write a C++ program that will allow you to input a set of integers, calculate the squares of the integers and display the numbers and their squares. The number of integers that you can enter will vary from run to run. You will have to declare the integer arrays and since you do not know the exact number of items you may want to declare arrays to be of dimension 100.When entering the data you may want to use an infinite loop and use a sentinel value of your choosing to determine when to exit the loop. To calculate a power in C++ you must use the C++ poe function.

Explanation / Answer

#include<iostream>

#include<math.h>

using namespace std;

int main(){

int arr[100];

int i=0;

  

while(true)

{

cout << "Input a number(0 to exit) : ";

cin >> arr[i];

  

if(arr[i]==0)

break;

i++;

}

  

cout << "Number Square of Number ";

for(int j=0;j<i;j++)

cout << arr[j] << " " << pow(arr[j],2) << endl;

  

return 0;

}