- 2
C Code to print particular alphabet followed by number of times alphabet occurs in a string.
input- aaaaabbbbccccddd output - a5b4c4d3 https://code.sololearn.com/cpLMmuV5dFtc/?ref=app
6 Antworten
+ 4
saquib jack
I need you to show code, to prove that you tried to do it yourself.
+ 1
saquib jack ,
I just uncommented everything inside main and your another function to check whether it compiles or not... by doing same, I got stray error code which means there are some special characters in-between which compiler don't understand...
I would suggest you to rewrite whole code again manually rather than copying directly into code playground to avoid special characters getting copied to code...
Another point I observed is void return type for main... It is recommended to use int main and return 0 at end of function...
Additionally , you are doing scanf with %s .. as you are looking for single character through particular scanf, it should be %c..
post your updated code and let us know if you still face issue in code...
Another approach to count character in string is to use count method of algorithm header file...
+ 1
i write the same code once again and it's working I think I m copying it that's the mistake bcz the same code is already working on my lappy
.... thnks Ketan Lalcheta
0
Hey saquib jack.What's the problem?
0
no problem actually I m posting the code not only problem
0
sry for late. the code is not working here but it is working in my Linux compiler.
you can compile and run this code in your laptop or Pc whatever you have
https://code.sololearn.com/cpLMmuV5dFtc/?ref=app