Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main()
- {
- char str_in[100],vowels[5][5];
- int len,i,j,tmp;
- for(i=0;i<5;i++)
- {
- vowels[i][0] = "aeiou"[i];
- vowels[i][1] = '0';
- }
- printf("Enter your string (number of character has to be less than 100): ");
- scanf("%s",str_in);
- len = strlen(str_in);
- printf("Length of the string entered is %d\n",len);
- for(i=0;i<len;i++)
- {
- for(j=0;j<5;j++)
- if(str_in[i]==vowels[j][0])
- {
- tmp = (int)vowels[j][1];
- tmp++;
- vowels[j][1] = (char)tmp;
- }
- }
- for(i=0;i<5;i++)
- {
- printf("%c : %c\n",vowels[i][0],vowels[i][1]);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment