Here ya go buddy. I'm assuming this is not homework...
Code:
#include <iostream>
using namespace std;
void findSquareCube(int LowValue, int HighValue,int Increment)
{
int memLowValue = LowValue;
while(memLowValue <= HighValue)
{
LowValue = memLowValue;
cout << LowValue << " ";
LowValue *= LowValue;
cout << LowValue;
LowValue *= memLowValue;
cout << " " << LowValue << "\n";
memLowValue += Increment;
}
}
int main()
{
int LowValue=0;
int HighValue=0;
int Increment=0;
cout <<"\n\nEnter high value ";
cin >> HighValue;
cout << "Enter low value ";
cin >> LowValue;
while(LowValue > HighValue)
{
cout << "\nSorry, but low value must be less than or equal to high value.\n"
"Please enter low value again ";
cin >> LowValue;
}
cout <<"\n\nEnter Increment value ";
cin >> Increment;
findSquareCube(LowValue, HighValue, Increment);
/*Don't be confused by these next 9 lines of code they are just to pause the program
before termination - no big deal... */
cout << "\n\n\nPress enter to EXIT program...";
int ch;
if(cin.peek() < 0)
{
while ( (ch=cin.get()) != EOF && ch != '\n' );
}
cin.get();
return 0;
}