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; }

25th Apr 2020, 2:19 PM
Abc def
Abc def - avatar
6 ответов
+ 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]!=" " ;
25th Apr 2020, 4:14 PM
Abhay
Abhay - avatar
+ 1
Abhay wrote: "a if loop" :D you made my day!
25th Apr 2020, 4:50 PM
visph
visph - avatar
+ 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
27th Apr 2020, 11:49 PM
Abhay
Abhay - avatar
+ 1
Abc def replace: if(ch[i]!='`'){ ... by: if(ch[i]!='`' && ch[i]!=' '){
28th Apr 2020, 7:44 AM
visph
visph - avatar
0
Uh didn't noticed that !
25th Apr 2020, 4:55 PM
Abhay
Abhay - avatar
- 1
to reach more users dude
27th Apr 2020, 11:45 PM
Abc def
Abc def - avatar