please see my code_https://ide.codingblocks.com/s/282332
Code producing wrong output!
@Nikhil-Jettley-2567269533523013

you are just checking if prime[1] is prime or not, it should be prime[i] here.
it is giving correct answer now : https://ide.codingblocks.com/s/287772