My code is not running

as it not displaying any output

Check now.
We cannot make an integer array of size greater than 10^7. Try it using a boolean array for size>10^7