Getting TLE in the question

at line no 13
for(long long int j =i*i;j<=1000000;j<j+i)
this is wrong at increment condition

correct statement is
for(long long int j =i*i;j<=1000000;j=j+i)

if you want to ask something about this feel free to ask
i hope this helps
if yes show your response with :heart: and don’t forgot to mark doubt as resolved