Code:
#include <stdio.h>
#include <string.h>
int main(){
char message [50];
int A=0,x=0,j;
int counter[26];
memset(counter,0,26);
//memset(j,0,26);
printf("Enter your secret message:");
gets(message);
for( j=0; j<sizeof(message); j++){
for(x=0;x<26;x++)
if (message[j] == 65+x || message[j] == 65+x+32){
printf("TeDeNg\n");
counter[x]++;
x=27;
}
}
//for(j=0;j<26;j++)
// printf("%c or %c total %d\n",65+j,65+j+32,counter[j]);
for(x=0;x<26;x++)
printf("%c or %c total %d\n",65+x,65+x+32,counter[x]);
return 0;
}
++++++++++++++++++++++++++++++++++++++++++++++++=
hi all.this program should count the frequency of character occured.
the problem is it only counts frequency of char a to f..
and start from g until z, it ill give strange char, like the variable hold null value..
could anyone pls help me with this..
thank u very much
-hasoon-