CPP-Reading till end of file doubt

#include
#include<conio.h>
using namespace std;
int main()
{
int a;
while(scanf("%d",&a)!=EOF)
{
cout<<a*a<<endl;
}
return 0;
}
I tried this same program taught to me in the video but is is showing error in sublime text 3… Why?? Is this program wrong??

hey @Sheenagoyal21, this code is working absolutely fine here. May there is some issue with the compiler there.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.