Check it is ‘vowel’ or ‘consonant’ using conditional operator also in C language..

Check out Inputs character is ‘vowel’ or consonant..

Some meaning Error likes cheack

Correct meaning check..

Some important symbols used in code.

  • () small bracket
  • && use for ‘and’ use for address
  • {} curly bracket
  • “” double code
  • || or
  • ? Question mark
  • #include<stdio.h>
  • #include<conio.h>
  • void main()
  • {
  • char ch;
  • clrscr();
  • printf(“Inputs the character to check it is a vowel or consonant”);
  • scanf(“%c”, &ch);
  • if(ch==’a’ ||ch==’A’ ||ch==’e’ ||ch==’E’ ||ch==’i’ ||ch==’I’ ||ch==’o’ ||ch==’O’ ||ch==’u’ ||ch==’U’ )
  • {
  • printf(“it is a vowel = %c”, ch);
  • }
  • else
  • {
  • Printf(“it is a consonant or Invalid”);
  • }
  • getch();
  • }

Inputs..

If you input any character it determines vowel or consonant…

Results..

Check vowel & consonant using conditional operators…

  • #include<stdio.h>
  • #include<conio.h>
  • void main()
  • {
  • char ch;
  • clrscr();
  • printf(“Inputs the character to check it is a vowel or consonant”);
  • scanf(“%c”, &ch);
  • ch==’a’ ||ch==’A’ ||ch==’e’ ||ch==’E’ ||ch==’i’ ||ch==’I’ ||ch==’o’ ||ch==’O’ ||ch==’u’ ||ch==’U’? printf(“it is a vowel = %c”, ch):Printf(“it is a consonant or Invalid”);
  • getch();
  • }

Inputs..

If you input any character it determines vowel or consonant…

Results..

Design a site like this with WordPress.com
Get started