Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main ()
- {
- char paragraph[] = "AMERICAN INTERNATIONAL UNIVERSITY-BANGLADESH (AIUB) envisions promoting professionals and excellent leadership catering to the technological progress and development needs of the country.";
- int i,j,vow=0,cons=0,digi=0,spc=0;
- char *vowel = "AEIOUaeiou";
- char *consonant = "BCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz";
- char space = ' ';
- int digit[10]= {0,1,2,3,4,5,6,7,8,9};
- for (i=0; vowel[i] != '\0' ;i++)
- {
- for(j=0; paragraph[j] != '\0' ; j++)
- {
- if (vowel [i] == paragraph [j])
- {
- vow++;
- }
- }
- }
- printf("Number of Vowel is: %d\n",vow);
- for (i=0; consonant[i] != '\0' ;i++)
- {
- for(j=0; paragraph[j] != '\0' ; j++)
- {
- if (consonant [i] == paragraph [j])
- {
- cons = cons + 1;
- }
- }
- }
- printf("Number of Consonant is: %d\n",cons);
- for (i=0; i<10 ;i++)
- {
- for(j=0; paragraph[j] != '\0' ; j++)
- {
- if (digit [i] == paragraph [j])
- {
- digi = digi + 1;
- }
- }
- }
- printf("Number of Digit is: %d\n",digi);
- for(i=0; paragraph[i] != '\0' ; i++)
- {
- if (paragraph[i] == space)
- {
- spc = spc + 1;
- }
- }
- printf("Number of White Space is: %d\n",spc);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment