0

How to delete negative no from array

only in C language

14th Aug 2018, 8:24 AM
jyo berwal
2 Réponses
+ 5
In general, shift all non negatives down overwriting the negatives. update the count of valid array elements to reflect the numbers tossed. {5, -3, 4} has 3 elements. The 4 gets moved overwriting the -3 and there are now 2 elements left.
14th Aug 2018, 12:23 PM
John Wells
John Wells - avatar
+ 1
jyo berwal , this is question answer section.. please don't expect people to code for you entirely... do share your code and let us know where you are confused or stuck... doing it yourself will help you to put your learning into implementation
14th Aug 2018, 8:41 AM
Ketan Lalcheta
Ketan Lalcheta - avatar