i need a program that takes input numbers and print stars as many as the numbers count then sort the numbers decreasing. all the functions have to be in a header file.
#include <iostream>
using namespace std;
int read(int a[],int n)
{
int i=0;
cout<<"please enter numbers: ";
do
cin>>a[i];
while (a[i++]>-1 && i<n);
return (i-1);
}
void print(int const a[], int const n)
{
for(int i=0;i<n;i++)
cout<<a[i]<<"* ";
cout<<endl;
}
void sort(int a[], int const n)
{
for (int i=1; i<n;i++)
for(int j=0;j<n-i;j++)
if(a[j]>a[j+1]) swap (a[j],a[j+1]);
}
this is as far as i got but i don't know how to print the stars and to use the header in the main program.