0% found this document useful (0 votes)
15 views

Smallest Vowel in A String

Uploaded by

Yasir Imam
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Smallest Vowel in A String

Uploaded by

Yasir Imam
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

## Problem Statement

Write a program to print the smallest vowel in a given string

## Input

matrix

## Output

## Explanation

> The vowels in the given string are `a` and `i`.
> And the alphabetically smallest between them is `a`.

## Solution:-
import java.util.Scanner;
class Solution{
public static void main(String args[]){
Scanner str=new Scanner(System.in);
String word=str.nextLine();
str.close();
String []vowels={"a","e","i","o","u"};
for(int i=0;i<vowels.length;i++){
if(word.contains(vowels[i])){
System.out.println(vowels[i]);
break;

}
}
}
}

You might also like