C

Consonent in range

76
0

The program must accept two lower case alphabets CH1 and CH2 as the input. The program must print all the consonants from CH1 to CH2 as the output.

Input Format:

The first line contains CH1 and CH2 separated by a space.

Output Format:

The first line contains all the consonants from CH1 to CH2.

Example Input/Output 1:

Input

a z

Output:

b c d f g h j k l m n p q r s t v w x y z

Explanation:

All the consonants (except the vowels) from a to z are printed as the output.

Example Input/Output 2:

Input:

v h

Output:

v t s r q p n m l k j h

#include<stdio.h>
	int main()
	{
		char a,b;
		scanf("%c %c",&a,&b);
		if(a<=b)
		{
			for(;a<=b;a++)
			{
				if(a!='a' && a!='e' && a!='i' && a!='o' && a!='u')
				printf("%c ",a);
			}
		}
		else
		{
			for(;a>=b;a--)
			{
				if(a!='a' && a!='e' && a!='i' && a!='o' && a!='u')
				printf("%c ",a);
			}
		}
	}
Hephzibai
WRITTEN BY

Hephzibai

Hephzibai is a driven third-year student at St. Joseph's Institute of Technology, specializing in Computer Science and Engineering. With a keen interest in data science and also in fullstack.
One of my greatest strengths lies in my programming skills, which I've honed through countless hours of practice and participation in coding challenges. Platforms like Skillrack, HackerRank, and others have been my playgrounds, where I've tackled a wide range of problems with creativity and determination.

Leave a Reply

Your email address will not be published. Required fields are marked *