Using pointers, write a program in ‘C’ to count the occurrence of each character in a given string. 10m Dec2006
Using pointers, write a program in ‘C’ to count the occurrence of each character in a given string. 10m Dec2006 #include <stdio.h> #include <string.h> void main() { char string[100],*ptr; int c=0,count[26]={0}; clrscr(); printf(“Enter a string\n”); gets(string); ptr=string[0]; while (*ptr) { /* Consider characters from ‘a’ to ‘z’ only */ if ( ptr >= ‘a’… Read More »