wap to enter a character from user ,check and print it is vowel or consonant.(switch)





#include<stdio.h>
#include<conio.h>
 main()

{

    char ch;
    
    printf("enter any alphabate : ");
    scanf("%c",&ch);
    switch (ch)
    {
     case 'a' : printf("vowel");
            break;

     case 'e' : printf("vowel");
            break;


     case 'i' : printf("vowel");
            break;


     case 'o' : printf("vowel");
            break;


     case 'u' : printf("vowel");
            break;


     case 'A' : printf("vowel");
            break;


     case 'E' : printf("vowel");
            break;


     case 'I' : printf("vowel");
            break;

     case 'O' : printf("vowel");
            break;


     case 'U' : printf("vowel");
            break;


    default : printf("it is a constant");

     }
    


}

output 1 :

enter any alphabate : a vowel


output 2 :

enter any alphabate : R
it is a constant



Comments

Popular Post

Define a class to represent a Bank Account. Include the following members: Data Members: i. Name of the depositor ii. Account number iii. Type of account iv. Balance amount in the account Member Functions: 1. To Input initial values 2. To deposit an amount 3. To withdraw an amount after checking the balance 4. To display name and balance Also write constructor for this class that takes four arguments. It should also handle type of account as savings by default