Friday, 3 August 2018

Algorithm to check Input Character Check is Vowel or Consonant in C


Program To Input a Character From User And Check Enter Character Is Vowel or Consonant

/*program character is c or v*/
#include <stdio.h>
void main ()
{
char ch ;
clrscr () ;
printf ("/n Enter a character:") ;
scanf ("%c", & ch) ;
switch (ch)
{
case 'a';
printf ("/n vowel:") ;
break ;
case 'e';
printf ("/n vowel:") ;
break ;
case 'i';
printf ("/n vowel:") ;
break ;
case 'o';
printf ("/n vowel:") ;
break ;
case 'u';
printf ("/n vowel:") ;
break ;
default :
printf ("/n character is consonant:") ;
}
getch () ;
}

Output :: Enter a character :  a

                   Character is vowel
                 
                   Enter a character :   z
     
                  character is consonant 

ALGORITHM :: 

                                CHECK INPUT CHARACTER IS VOWEL OR CONSONANT

This is a program of having to check input character is vowel or consonant .

STEP 1. START.
STEP 2. INPUT A CHARACTER.
STEP 3. [ CHECK VOWEL OR CONSONANT ]
                1. IF ENTER CHARACTER IS A , E , I . O , U ]
                2. PRINT CHARACTER IS VOWEL.
                3. OTHERWISE.
                4. PRINT CHARACTER IS CONSONANT.
             [ STEP LOOP 3 IS END ]
STEP 4. STOP.

1 comment:

Featured post

Program to find Volume of given box in java

class volume { public static void main (String args []) { int l=5,b=6,h=10; int volume; volume=l*b*h; System.out.println (" vol...