Vowel program

Vowel program in c

#include<stdio.h>
#include<conio.h>
void main()
{
	char ch;
	printf("Enter any Character \n");
	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("Character is a vowel");
	}
	else
	{
		printf("Character is not a vowel");
	}
	getch();
}

Output

Enter any Character
a
Character is a vowel

Vowel program in c++

#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
	char ch;
	cout<<"Enter any Character \n";
	cin>>ch;
	if((ch=='a')||(ch=='A')||(ch=='e')||(ch=='E')||(ch=='i')
		||(ch=='I')||(ch=='o')||(ch=='O')||(ch=='u')||(ch=='U'))
	{
		cout<<"Character is a vowel";
	}
	else
	{
		cout<<"Character is not a vowel";
	}
	getch();
}

Output

Enter any Character
e
Character is a vowel

Vowel program in c#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CheckVowelProject
{
    class Program
    {
        static void Main(string[] args)
        {
            char ch;
            Console.WriteLine("Enter any character");
            ch = Convert.ToChar(Console.ReadLine());
            if ((ch == 'a') || (ch == 'A') || (ch == 'e') || (ch == 'E') || (ch == 'i')
        || (ch == 'I') || (ch == 'o') || (ch == 'O') || (ch == 'u') || (ch == 'U'))
            {
                Console.WriteLine("Character is a vowel");
            }
            else
            {
                Console.WriteLine("Character is not a vowel");
            }
            Console.ReadLine();
        }
    }
}

Output

Enter any character
i
Character is a vowel

Vowel program in java

import java.util.*;
class examples
{
public static void main(String[] args)
	{
	String ch;
	Scanner sc=new Scanner(System.in);
	 System.out.println("Enter any character");
     ch = sc.next();
     if ((ch.charAt(0) == 'a') || (ch.charAt(0) == 'A') || (ch.charAt(0) == 'e') || (ch.charAt(0) == 'E')
        || (ch.charAt(0) == 'i')|| (ch.charAt(0) == 'I') || (ch.charAt(0) == 'o') || (ch.charAt(0) == 'O')
        || (ch.charAt(0) == 'u') || (ch.charAt(0) == 'U'))
     {
    	 System.out.println("Character is a vowel");
     }
     else
     {
    	 System.out.println("Character is not a vowel");
     }
	}
}

Output

Enter any character
U
Character is a vowel

Write a comment


Name Email Message