#include #include using namespace std; int main() { ofstream File; unsigned long long x = 1; int s; File.open("File.txt",ios::app); while (true) { s = (x*x); cout << s << endl; File << s << endl; x++; } // This bit's pretty pointless, isn't it? :P File.close(); return 0; }