33. Find and display number of vowels and consonants in the string.


Comments

  1. sayali daunde11:37 AM

    //counting vowels n conconents in string
    #include
    #include
    void main()

    {
    char str[10];
    int i=0,cnt1=0,cnt2=0;

    printf("Enter the string=");
    gets(str);
    while(str[i]!=NULL)
    {
    if(str[i]=='a'||str[i]=='e'||str[i]=='o'||str[i]=='u'||str[i]=='i')
    {
    cnt1++;
    }
    else
    {
    cnt2++;
    }
    i++;
    }
    printf("\ntotal vowels=%d total conconents=%d",cnt1,cnt2);

    }

    ReplyDelete
  2. Swati Waghmare11:39 AM

    /*To count the total no.of vowel & consonant*/
    #include
    #include
    void main()
    {
    char str[10];
    int i=0,cnt1=0,cnt2=0;
    printf("\n\tEnter a string");
    gets(str);
    while(str[i]!=NULL)
    {
    if(str[i]=='a'|| str[i]=='e'|| str[i]=='i'|| str[i]=='o'|| str[i]=='u')
    {
    cnt1++;
    }
    else
    {
    cnt2++;
    }
    i++;
    }
    printf("Total no. of vowel=%d \n\t Total no. of consonant=%d",cnt1,cnt2);
    }

    ReplyDelete
  3. Pandhare Dipali11:42 AM

    /*To count the total no.of vowel & consonant*/
    #include
    #include
    void main()
    {
    char str[10];
    int i=0,cnt1=0,cnt2=0;
    printf("\n\tEnter a string");
    gets(str);
    while(str[i]!=NULL)
    {
    if(str[i]=='a'|| str[i]=='e'|| str[i]=='i'|| str[i]=='o'|| str[i]=='u')
    {
    cnt1++;
    }
    else
    {
    cnt2++;
    }
    i++;
    }
    printf("Total no. of vowel=%d \n\t Total no. of consonant=%d",cnt1,cnt2);
    }

    ReplyDelete
  4. poonam pusavale11:43 AM

    /*display vowel and consonant using string*/
    #include
    #include
    void main()
    {
    char str[10];
    int i=0,cnt1=0,cnt2=0;
    printf("\n\t enter a string");
    gets(str);
    while(str[i]!=NULL)
    {
    if(str[i]=='a'||str[i]=='e'||str[i]=='i'||str[i]=='o'||str[i]=='u')
    {
    cnt1++;
    }
    else
    {
    cnt2++;
    }
    i++;
    }
    printf("\n\t total vowel=%d \n\t total consonant=%d",cnt1,cnt2);
    }

    ReplyDelete
  5. //counting no.of vowels & consonant from given string
    #include
    #include
    void main()
    {
    char s[10]={"krishna"};
    int c1=0,c2=0,i=0;
    while (s[i]!=NULL)
    {
    if (s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u')
    {
    c1++;
    }
    else
    {
    c2++;
    }
    i++;
    }
    printf("\n Total vowels=%d \t Total consonant=%d \n",c1,c2);
    }

    ReplyDelete
  6. #include
    #include
    void main()
    {
    char str[50];
    int i=0,cnt1=0,cnt2=0;
    printf("enter a string=");
    gets(str);
    while(str[i]!=NULL)
    {
    if(str[i]=='a'||str[i]=='e'||str[i]=='i'||str[i]=='o'||str[i]=='u')
    {
    cnt1++;
    }
    else
    {
    cnt2++;
    }
    i++;
    }
    printf("number of vowels=%d\nnumber of consonant=%d\n",cnt1,cnt2);
    }

    ReplyDelete
  7. Dipali Kore12:11 PM

    //counting vowels n consonants of string
    #include
    #include
    void main()
    {
    char s[10];
    int cnt1=0,cnt2=0,i=0;
    printf("\nenter ur string");
    gets(s);
    while(s[i]!=NULL)
    {
    if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u')
    {
    cnt1++;
    }
    else
    {
    cnt2++;
    }
    i++;
    }
    printf("\ntotal vowels=%d total consonant=%d",cnt1,cnt2);
    }

    ReplyDelete
  8. Bhanvase Yashoda12:31 PM

    /*count vowel & consonent*/
    #include
    #include
    #include
    void main()
    {

    char str[8];
    int cnt1=0,cnt2=0; int i;
    printf("\n\t enter sting");
    gets(str);
    while(str[i]!=NULL)
    {
    if(i=='a'||i=='e'||i=='i'||i=='o'||i=='u')
    {
    cnt1++;
    }
    else
    {
    cnt2++;
    }
    i++;
    }
    printf("total vowel=%d,consonent=%d",cnt1,cnt2);





    }

    ReplyDelete
  9. sonali nagane12:32 PM

    #include
    #include
    void main()
    {
    char str[10];
    int i=0, cnt1=0,cnt2=0;
    printf("\n enter the string");
    gets(str);
    while(str[i]!=NULL)
    {
    if(str[i]=='a'||str[i]=='e'||str[i]=='i'||str[i]=='o'||str[i]=='u')
    {
    cnt1++;
    }
    else
    {
    cnt2++;
    }
    i++;
    }
    printf("\n total no of vowel=%d consonent=%d",cnt1,cnt2);

    }

    ReplyDelete
  10. mubin pirjade11:02 AM

    /* PROGRAM TO COUNT NUMBER OF VOWELS AND CONSONANTS FROM STRING*/
    # include
    # include
    void main( )
    {
    char str[20];
    int i=0, cnt1=0, cnt2=0;
    printf("Enter a string:");
    scanf("%s",str);
    while(str[i]!=NULL)
    { if (str[i]=='a' || str[i]=='e' || str[i]=='i' || str[i]=='o' || str[i]=='u')
    {
    cnt1++; // cnt1 count characters which are vowel.
    }
    else
    {
    cnt2++; // cnt2 counts when characters are not vowel
    }
    i++;
    }
    printf("\n Total number of Vowels=%d”, cnt1);
    printf("\n Total number of Consonants =%d”, cnt2 );
    }

    ReplyDelete
  11. sachita jadhav11:13 AM

    /* count vowel & consonant of string */
    #include
    #include
    #include
    void main()
    {
    char str[10];
    int i=0;cnt1=0,cnt2=0;
    printf("enter string");
    gets(str);
    while(str[i]!=NULL)
    {
    if(str[i]=='a'||str[i]=='e'||str[i]=='i'||str[i]=='o'||str[i]=='u')
    {
    cnt1++;
    }
    else
    {
    cnt2++;
    }
    printf("\n total vowel=%d total consonant=%d",cnt1,cnt2);
    }
    }

    ReplyDelete
  12. Awate Snehal12:00 PM

    /*No of vowel n consonant*/
    #include
    #include
    void main()
    {
    char s[10];
    int i=0,cnt1=0,cnt2=0;
    printf("\n\t enter a string");
    gets(s);
    while(s[i]!=NULL)
    {
    if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u')
    {
    cnt1++;
    }
    else
    {
    cnt2++;
    }

    i++;
    }
    printf("\n\t total no of vowel=%d,total no of consonanat=%d",cnt1,cnt2);
    }

    ReplyDelete

Post a Comment