Guys wanna point out where i am making mistake !. All the conditions got matched except the last one i can’t figure out a way to find the largest number among negative numbers.please check my code.help me with this.
I see ! So you are suggesting to log out the last condition as : else condition of the program. That might work but i can’t figure out the algo for that. i mean i can’t just console.log the rest of the part.I have to find the largest number among the negative ones.
I hope that you realized, with the flag being set to 0 initially, it will cause the IF statement to always result in a FALSE when it checks the array of negative numbers.