This is what i have done so far
but i want the output like that
square#1:not an increasing square
square#2: increasing square
square#3: not an increasing square
please help
Help with Code Tags
C++ Syntax (Toggle Plain Text)
#include <iostream>
#include <fstream> // Header to use input and output
#include <string>
using namespace std;
void main()
{
ifstream ifile; // declare file stream variables
ofstream ofile;
int m[20][20];
int i , j , n;
char fileName[100];
cout <<" please enter the name of the data file "<< endl; // prmot the user to enter the name of the datafile
cin>>fileName; // user inputs the file
ifile.open(fileName); // ifile stream looks for the file
ifile>>n;
cout<<"The data for "<< n << " squares to check. " <<endl;
cout << "\n";
for (i=0; i<12; i++)
{
for(j=0;j<4;j++){
ifile>>m[i][j];
}
}
for (i=0;i<12;i++)
{
cout << "\n| ";
for (j=0;j<4;j++)
{
cout << " | ";
cout << m[i][j];
}
}
ifile.close();// c;ose file stream variables
ofile.close();
}