cout << "Y or y to continue, if you want to EXIT press any key." << endl;
cin >> yes;
} while (yes == 'Y' || yes == 'y');
cout << "Thank you and Good-Bye" << endl;
outDataFile.close();
system("pause");
return 0;
}
void five(char num1, ofstream& fout1)
{
int i = 1;
cout << "Your numbers squared are:\n";
fout1 << "Your numbers squared are:\n";
while (i <= 5)
{
cout <<"***" << i * i;
fout1 << "***" << i * i;
i++;
}
cout << endl;
fout1 << endl;
if (1 % 2 == 0)
i = 1;
else
i = 1 + 1;
cout << "The even numbers are:\n";
fout1 << "The even numbers are:\n";
while (i <= 5)
{
cout << "***" << i * i;
fout1 << "***" << i * i;
i = i + 2;
}
cout << endl;
fout1 << endl;
if (1 % 2 == 1)
i = 1;
else
i = 1 + 1;
cout << "The odd numbers are:\n";
fout1 << "The odd numbers are:\n";
while (i <= 5)
{
cout << "***" << i * i;
fout1 << "***" << i * i;
i = i + 2;
}
cout << endl;
fout1 << endl;
cout << "Your numbers squared are:\n";
fout2 << "Your numbers squared are:\n";
while (i <= 6)
{
cout << "***" << i * i;
fout2 << "***" << i * i;
i++;
}
cout << endl;
fout2 << endl;
if (1 % 2 == 0)
i = 1;
else
i = 1 + 1;
cout << "The even numbers are:\n";
fout2 << "The even numbers are:\n";
while (i <= 6)
{
cout << "***" << i * i;
fout2 << "***" << i * i;
i = i + 2;
}
cout << endl;
fout2 << endl;
if (1 % 2 == 1)
i = 1;
else
i = 1 + 1;
cout << "The odd numbers are:\n";
fout2 << "The odd numbers are:\n";
while (i <= 6)
{
cout << "***" << i * i;
fout2 << "***" << i * i;
i = i + 2;
}
cout << endl;
fout2 << endl;
cout << "Your numbers squared are:\n";
fout3 << "Your numbers squared are:\n";
while (i <= 7)
{
cout << "***" << i * i;
fout3 << "***" << i * i;
i++;
}
cout << endl;
fout3 << endl;
if (1 % 2 == 0)
i = 1;
else
i = 1 + 1;
cout << "The even numbers are:\n";
fout3 << "The even numbers are:\n";
while (i <= 7)
{
cout << "***" << i * i;
fout3 << "***" << i * i;
i = i + 2;
}
cout << endl;
fout3 << endl;
if (1 % 2 == 1)
i = 1;
else
i = 1 + 1;
cout << "The odd numbers are:\n";
fout3 << "The odd numbers are:\n";
while (i <= 7)
{
cout << "***" << i * i;
fout3 << "***" << i * i;
i = i + 2;
}
cout << endl;
fout3 << endl;
cout << "Your numbers squared are:\n";
fout4 << "Your numbers squared are:\n";
while (i <= 8)
{
cout << "***" << i * i;
fout4 << "***" << i * i;
i++;
}
cout << endl;
fout4 << endl;
if (1 % 2 == 0)
i = 1;
else
i = 1 + 1;
cout << "The even numbers are:\n";
fout4 << "The even numbers are:\n";
while (i <= 8)
{
cout << "***" << i * i;
fout4 << "***" << i * i;
i = i + 2;
}
cout << endl;
fout4 << endl;
if (1 % 2 == 1)
i = 1;
else
i = 1 + 1;
cout << "The odd numbers are:\n";
fout4 << "The odd numbers are:\n";
while (i <= 8)
{
cout << "***" << i * i;
fout4 << "***" << i * i;
i = i + 2;
}
cout << endl;
fout4 << endl;
cout << "Your numbers squared are:\n";
fout5 << "Your numbers squared are:\n";
while (i <= 9)
{
cout << "***" << i * i;
fout5 << "***" << i * i;
i++;
}
cout << endl;
fout5 << endl;
if (1 % 2 == 0)
i = 1;
else
i = 1 + 1;
cout << "The even numbers are:\n";
fout5 << "The even numbers are:\n";
while (i <= 9)
{
cout << "***" << i * i;
fout5 << "***" << i * i;
i = i + 2;
}
cout << endl;
fout5 << endl;
if (1 % 2 == 1)
i = 1;
else
i = 1 + 1;
cout << "The odd numbers are:\n";
fout5 << "The odd numbers are:\n";
while (i <= 9)
{
cout << "***" << i * i;
fout5 << "***" << i * i;
i = i + 2;
}
cout << endl;
fout5 << endl;
}
void ten(char num6, ofstream& fout6)
{
int i = 1;
cout << "Your numbers squared are:\n";
fout6 << "Your numbers squared are:\n";
while (i <= 10)
{
cout << "***" << i * i;
fout6 << "***" << i * i;
i++;
}
cout << endl;
fout6 << endl;
if (1 % 2 == 0)
i = 1;
else
i = 1 + 1;
cout << "The even numbers are:\n";
fout6 << "The even numbers are:\n";
while (i <= 10)
{
cout << "***" << i * i;
fout6 << "***" << i * i;
i = i + 2;
}
cout << endl;
fout6 << endl;
if (1 % 2 == 1)
i = 1;
else
i = 1 + 1;
cout << "The odd numbers are:\n";
fout6 << "The odd numbers are:\n";
while (i <= 10)
{
cout << "***" << i * i;
fout6 << "***" << i * i;
i = i + 2;
}
cout << endl;
fout6 << endl;
Say, how many digits there in number 10? And how do you intend to fit in variable containing only one character? And why didn't you noticed compiler screaming bloody murder about multicharacter literal?
warning: multi-character character constant [-Wmultichar]
(If it doesn't scream at you either configure it properly or get a better compiler)