0
blanks
Guys hi! in this code i dont want t blanks count but this code does it how can i prevent it #include<stdio.h> #include<conio.h> #include<locale.h> int main() { setlocale(LC_ALL, "Turkish"); char ch[100]; int i,j,k; again: printf("\nwrite your sentence..\n"); gets(ch); for(i=0;ch[i]!='\0';i++){ k=1; for(j=i+1;ch[j]!='\0';j++){ if(ch[i]==ch[j]){ k++; ch[j]='`'; } } if(ch[i]!='`'){ //karakterlerin tekrarlamaması için yardım aldım.. printf("\n%c's frequency is= %d ",ch[i],k); } } goto again; }
6 odpowiedzi
+ 1
Why include other languages in tag when it's about c?
maybe add an if statement after first for loop? like
if ch[i]!=" " ;
+ 1
Abhay wrote: "a if loop"
:D you made my day!
+ 1
What you mean by more users ? do you really think other language guys would notice this ?even the one who has knowledge in certain language will ignore it
+ 1
Abc def replace:
if(ch[i]!='`'){
... by:
if(ch[i]!='`' && ch[i]!=' '){
0
Uh didn't noticed that !
- 1
to reach more users dude