Saturday, June 13, 2020

both vowel or consonant alphabets in c

The program must accept two lower case alphabets A and B as the input. The program must print Yes as the output if both the alphabets are either vowels or consonants. Else the program must print No as the output.

Example Input/Output 1:
Input:
a m

Output:
No



solution:


int main(){
char a,b;
scanf("%c %c,&a,&b);
if(  (  (a=='a'||a=='e'||a=='i'||a=='o'||a=='u')&&(b=='a'||b=='e'||b=='i'||b=='o'||b=='u')  ) || ( (a!='a'&&a!='e'&&a!='i'&&a!='o'&&a!='u')&&(b!='a'&&b!='e'&&b!='i'&&b!='o'&&b!='u') ) )
{
    pritnf("Yes");    
}
else{
printf("No");
}
}

No comments:

Post a Comment

MFIB Comma Separated Integers

Fill in the blanks with code so that the program must accept three integers separated by a space and print them separated by a comma as the ...