Search This Blog

Monday, 18 May 2020

programming C(switch structure)

   in put a character and display the vowel or not
(switch content)

#include <stdio.h>
#include <stdlib.h>

int main()
{
   char ch;
   printf("enter a character");
   scanf("%c",&ch);

   switch(ch)
   {
       case 'a':printf("a is a vowel");break;
       case 'e':printf("e is a vowel");break;
       case 'i':printf("i is a vowel");break;
       case 'o':printf("o is a vowel");break;
       case 'u':printf("u is a vowel");break;
       default:printf("%c is not a   vowel",ch);
   }
}

     


No comments:

Post a Comment

please wait...