how to ensure that the size of an array ( i.e. ‘n’ ) isn’t negative. i gave this condition in main function:
if(n<0)
{
return 0;
}
Size of an array
@himanshuep32 You do not need to ensure that as it is already given in the question that n is non-negative.
But if you need to ensure it then the condition given by you is correct.