60 688
Assignments Done
97,9%
Successfully Done
In April 2018

Answer to Question #27666 in C++ for Darren Jackson

Question #27666
How to write the function?

void print (const float x[], const int n){
for ( const float *p = x; p != x + n; ++p ) cout << ’\t’ << *p;
cout << endl;
}
Expert's answer
#include <iostream>

using namespace std;

void print(const float x[], const int n)
{
for (int k = 0; k < n; k++)
cout << '\t' << x[k];
cout << endl;
}

int main()
{
float x[] = {3.2, -5.14, 9.8};
print(x, 3);
return 0;
}

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