I have some input from a file that i put into an array and i need to do two things with this array. First i need to know how to modify it so that when i output it only 9 values will appear per line, and secondly i need to know how to determine which value occurs most frequently and then output that #.
Please help!
Here's what i have so far:
#include <iostream>
#include <fstream>
using namespace std;
#define SIZE 200
ifstream myin;
ofstream myout;
int main()
{
int x[SIZE],i=0,h=0;
myin.open("numbers.txt",ios::in);
while(myin>>x[i])
{
if(x[i]%5==0)
{
cout<<x[i]<<" ";
h++;
}
i++;
}
cout<<endl;
cout<<i<<endl;
cout<<h<<endl;
myin.close();
return 0;
}