Find Whether The Character Is Vowel Or Consonant From User Input.

This is a very cool programme and too much easy programme with us. Go and Do it With fun.

Input : Any Vowel (a,e,i,o,u)

Code:

#include<stdio.h>
int main()
{
    char a,e,i,o,u,ch;

    printf("  Enter the Character for check: ");
    scanf("%c", &ch);

    if(ch=='a')
    {
        printf("  Inputed Character is VOWEL");
    }

    else if (ch=='e')
    {
        printf("  Inputed Character is VOWEL");
    }

    else if (ch=='i')
    {
        printf("  Inputed Character is VOWEL");
    }

    else if (ch=='o')
    {
        printf("  Inputed Character is VOWEL");
    }

    else if (ch =='u')
    {
        printf("  Inputed Character is VOWEL");
    }

    else
    {
         printf("  Inputed Character is CONSONANT");
    }
    system("color B0");

    return 0;

}

Code Details:

We need to take some character as initializatin of programme. Ex: char a,e,i,o,u,ch; . Then we need to scan a character from user then we need to assign the value in “” scanf(“%c”, &ch); “”. We need to use “for loop” here for check the inputed user character. in ‘for loop’ we used ( ch==’a’ ) this to check the user input if it’s vowel or consonant. Here ( ch==’a’ ) we are checking that either value-‘a’ is in variable-‘ch’ or not.

OutPut/Console :

Need To Know:

  1. Data Type .
  2. Format Specifier .
  3. Variable and Constant .

Nahidul Islam

Actually life is not a bed of roses. Nahidul Islam wants to be an officer in Bangladesh Navy. Though he failed twice but he didn't loose hope. He is trying to get success to be an Ofiicer in Bangladesh Navy. He also love to do programming and problem solving. He is also great in Communication with others and he is a Quick Learner.Right now he is studying at ULAB in Bangladesh in "CSE". He has a plan to go abroad for B.Sc programme. At the moment he is working on The Tech Breach. website: www.thetechbreach.com

Leave a Reply

Your email address will not be published. Required fields are marked *