Test case 2 wrong

please find bug in my code. I’ve checked all the test cases and desired output is obtained. Still it is not validating my code for test case 2. please look into this.
link for my code - https://ide.codingblocks.com/s/212927

@pulkit_pandey09 you are looping till n, as n can be as big as 10^9 it will give tle, loop from 2 to sqrt(n) if number as any factor in between then not prime else it is prime.
If this resolves your doubt mark it as resolved.

still not resolved. looping from 2 to sqrt(n) { i*i < n}. test case 2 still not validated

@pulkit_pandey09 you are making flag 1, when number is not divisible, but when it is divisible you are not making the flag 0, this will cause the output to be “Not PrimePrime” for odd numbers, suppose n=9, now for i=2, flag becomes 1, now for 3 you will print NOT PRime but after exiting the loop you will check the flag, which would still be 1 so you will write prime also.
If this resolves your doubt mark it as resolved.