76 942
Assignments Done
Successfully Done
In June 2019

Answer to Question #39111 in C++ for Verasak Sitawan

Question #39111
Write C++ program that declares an array of 10 integers. Write a loop that accepts 10
values from the keyboard, and write another loop that displays the 10 values. Do not
use any subscripts within the two loops; use pointers only.
Expert's answer
#include <iostream>
#include <stdlib.h>

using namespace std;

int main (void)
const int SIZE = 10;
int array[SIZE];
cout << "Enter " << SIZE << " numbers:" << endl;
for (int *p = array; p < array + SIZE; ++p)
cin >> *p;
cout << endl << "The numbers:" << endl;
for (int *p = array; p < array + SIZE; ++p)
cout << *p << endl;

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions