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;
}
#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;
}