60 678
Assignments Done
97,7%
Successfully Done
In April 2018

Answer to Question #53183 in C++ for jemal

Question #53183
Define two functions which, respectively, input values for the elements of an array of real values and
output the array elements:
void ReadArray (double nums[], const int size);
void WriteArray (double nums[], const int size);
Expert's answer

Solution.
#include <iostream>

// The function prototypes
void ReadArray(double nums[], const int size);
void WriteArray(double nums[], const int size);

using namespace std;

void main()
{
const int size = 10;
double nums[size];

// Calling functions
ReadArray(nums, size);
WriteArray(nums, size);

// To pause
cin.get();
cin.get();

return;
}

void ReadArray(double nums[], const int size)
{
for (int i = 0; i < size; i++)
{
cout << "nums[" << i << "] = ";
cin >> nums[i];
}
}

void WriteArray(double nums[], const int size)
{
for (int i = 0; i < size; i++)
{
cout << nums[i] << '\n';
}
}

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