|no, no, no .... That's not the way to go!
You put some code with some syntax error and even some misconception in it.
That reveal that you are not understanding what your code has to do.
The compiler just gives some errors, but those errors are random as your code is. Attempting to fix those errors doesn't lead anywhere: you're never granted your code will do what you expect.
printf("Enter a string : ");
s is a pointer pointing to nowhere: where do ypu thoing your scanf can write to ?!?
s[l]=0; tries to write to nowhere since s is nowhere
a is a pointer to int, but you do
a=(char*)malloc(l): what did you want to do? allocating char-s or int-s ?!
This is a mess of tokens with no syntax meaning! Raed about the
for syntax, and understand the proper use of '()', ',', and ';'.
x=l-1 Wow... you're looking for problems: never use names like "O" and "l": I have to change font before find it's "l-1" and not "l-l" ... Do you get what I mean? If not, than that demonstrate the problem
Then: I see a
malloc, but i don't see a
free: not a good way to program...
I don't continue, but what can you do if you don't have clear in your mind what you're gonna do?
2 bugs found.
> recompile ...
65534 bugs found.