Pls help me! Character in c

Hey,
So I have coded a program for sorting character array in c but my output is showing useless characters
i also gave a space in scanf(" %c",&chararray1) but its not working out pls help its urgent
my char array size is 3 cuz the last one will be null and i need only 2 spaces

This is the code for scanning


this is for sorting pls help!

Can you please attach a copy of your full code @mihir6026

its a huge program and this is a very small part u will be lost

@viraj_007

It should be as simple as this… I don’t know why you are using chararray2… replace a in my code with the name of the character array you want to sort and it should work just fine. If the actual function of your code if different than just sorting the array then share the whole code and say accordingly please. :smile: