20. Program to Check Vowel or Consonant


Comments

  1. #include
    #include
    void main()
    {
    char a,e,i,o,u,A,E,I,O,U,c;
    clrscr();
    printf("Enter one Alfabet:-");
    scanf("%s",&c);
    if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='A'||c=='E'||c=='I'||c=='O'||c=='U')
    {
    printf("Entered Alfabet is Vowel");
    }
    else
    {
    printf("Entered Alfabet is Consonant");
    }
    getch();
    }

    ReplyDelete
  2. //*20. Program to Check Vowel or notvowel//
    #include
    #include
    void main()
    {
    char ch;
    clrscr();

    printf("\n\tEnter a character");
    scanf("%c", &ch);

    switch(ch)

    {
    case 'a':
    case 'A':
    case 'e':
    case 'E':
    case 'i':
    case 'I':
    case 'o':
    case 'O':
    case 'u':
    case 'U':
    printf("%c is a vowel.\n", ch);
    break;
    default:
    printf("%c is not a vowel.\n", ch);
    }
    getch();
    }

    ReplyDelete

Post a Comment