Array-promo

Question

program to print vowels in given word

Share code with your friends

Share on whatsapp
Share on facebook
Share on twitter
Share on telegram

Code

import java.util.Scanner;
public class vowelInWord
{
    public static void main(String[] args)
    {
        String wd="";
        char ch=' ';
        int i=0,len=0;
        Scanner sc = new Scanner(System.in);

        System.out.println("Enter a word");
        wd = sc.next();
        wd=wd.toLowerCase();
        System.out.println("given word:"+wd);
        System.out.println("vowels of word:");
        len=wd.length();
        for(i=0;i< len;i++)
        {
            ch=wd.charAt(i);
            if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')
            {
                System.out.println(ch);

            }



        }
    }
}

Coding Store

Sale

Original price was: ₹80.Current price is: ₹50.
Sale

Original price was: ₹250.Current price is: ₹150.
Sale

Original price was: ₹350.Current price is: ₹200.
Sale

Original price was: ₹80.Current price is: ₹50.
Sale

Original price was: ₹80.Current price is: ₹50.
Sale

Original price was: ₹80.Current price is: ₹50.
Sale
Mastering Array

Original price was: ₹80.Current price is: ₹50.
Sale

Original price was: ₹80.Current price is: ₹50.
Sale

Original price was: ₹80.Current price is: ₹50.

Leave a Reply

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