i am unable to get any output from this code
No output coming
HELLO @Divit-Goel-2940158062683318

use < in place of <= .becuase ur sieve size is 1000005 so maximum index u can access is 1000005 - 1.
also u r not reading n.
so add cin>>n; in line 37.