Hey I'm trying to make a table that ask users to enter a low number and high number. The program should calculate the square and cube for all number between the low and high. However my code won't compile. Any help?
Code:
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
string mystr;
int high=0;
int low=0;
int i=low;
cout << "Math Table /n";
cout << "Enter low number: ";
getline (cin,mystr);
stringstream(mystr) >> low;
cout << "Enter High number: " ;
getline (cin,mystr);
stringstream(mystr) >> high;
for (low < high)
printf("%8dNumber %8dSquare %8dCube\n ", i, i * i, i * i * i) ;
return 0;
}
Comment