How to swap odd and even components of an array using pointers in c language. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to swap odd and even components of an array using pointers in c language.

If there will be two odd numbers or two even numbers on consecutive indexes then they should not be swapped. I need a c code please I have been working on this for hours.

1st Dec 2018, 10:03 AM
k180226 Syed Hassan Ali
k180226 Syed Hassan Ali - avatar
5 Answers
+ 1
...but asking for your code enables people to answer using what you've already tried, which is really important for giving an answer that's usable. Without this people have to guess what you've done, which is like doing your homework for you (and that's not the goal here).
1st Dec 2018, 5:18 PM
Kirk Schafer
Kirk Schafer - avatar
0
I have done the same thing but don't know why the array is not being printed properly
1st Dec 2018, 10:46 AM
k180226 Syed Hassan Ali
k180226 Syed Hassan Ali - avatar
0
Can I get a c code plzz
1st Dec 2018, 10:47 AM
k180226 Syed Hassan Ali
k180226 Syed Hassan Ali - avatar
0
I just want to swap odd and even components of an array using pointers that's it.
1st Dec 2018, 10:50 AM
k180226 Syed Hassan Ali
k180226 Syed Hassan Ali - avatar
0
I understand you ok! But I don't know how to send my code here
1st Dec 2018, 5:27 PM
k180226 Syed Hassan Ali
k180226 Syed Hassan Ali - avatar