Test cases arent passing

Why is it inserting 0 in a.second pls help

hi @kunal81198 the problem with this code is that you are making array of size n, but you are taking input for values only which are >= x
so actually, number of elements in the array will be less than n.
But you are printing all n elements, so there will be some garbage values printed as well.

So what should i do?

@kunal81198 in the input for loop, if salary < x you can do n–
try this and let me know

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.