#include "iostream"
using namespace std;
int main(int argc, char const *argv[])
{
int n=100000;
int cost=6;
for (int i = 1; i <= n; ++i)
{
cout<<cost<<endl;
}
return 0;
}
The above program when compiled and run on ideone.com (online g++ compiler which uses SPOJ compiler) gives a Runtime Error. When the cout line is commented out, the program runs successfully. Can someone point out the reason for the same?
<iostream>).