Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://www.facebook.com/AminproPastebin
- #include <stdio.h>
- #include <string.h>
- int main(void)
- {
- char word[50];
- char vowel[20];
- char consonant[20];
- int i, vcount=0, ccount=0, len=0;
- printf("<* VOWEL & CONSONANT CHECKER *>");
- printf("Please enter a word: ");
- fgets(word,50, stdin );
- len = strlen(word);
- printf("Numeber or letter : %d", len);
- for (i=0; i<len; i++){
- if (word[i]=='a'||word[i]=='e'||word[i]=='i'||word[i]=='o'||word[i]=='u'){
- vowel[vcount]= word[i];
- vcount++;
- }
- else{
- consonant[ccount]= word[i];
- ccount++;
- }
- }
- printf("\nNumber of vowel: %d ->", vcount);
- for(i=0; i<vcount; i++){
- printf("%c", vowel[i]); }
- printf("\nNumber of consonant: %d ->", ccount);
- for(i=0; i<ccount; i++){
- printf("%c", consonant[i]); }
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement