Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<ctype.h>
- #include<stdio.h>
- int main(){
- char st[]="Hello World! I am Anirban";
- int ncons=0,nvow=0,size=sizeof(st)/sizeof(st[0]),i;
- for(i=0;i<size;++i){
- char c=tolower(st[i]);
- if(c=='a' || c=='e' || c=='i' || c=='o' || c=='u')
- nvow++;
- else if(c>='a' && c<='z')
- ncons++;
- }
- printf("No. of vows= %d\nNo. of cons= %d\n",nvow,ncons);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment