+ 1
Anyone know's how to sort odd and even number with array in c language ? If you know please show me how to do it
5 Answers
+ 5
I will give you basic idea of it, you have to code it yourself.
See, create an array with some elements(odd and even both)
Now in a for loop check every element like this a[i] % 2 == 0, cuz if that condition is true then it's even number else it's odd number.
Code it đ€
+ 2
One way, while checking even or odd, if it comes even assign that into other array, if it is odd assign it into another array. So you have separate arrays for even and odd
While printing print one odd, one even element using loops.. Be sure to stop printing, continue other if array sizes are not same.. You can get while coding... Hope this helps some...
0
Thank you though
0
But how to print it out with this order (even odd even odd, ...)
0
Well, thank's