Computer Science, asked by sumaiya2406, 3 months ago

Write a java program to reverse the first and last vowel of a string.​

Answers

Answered by bis553
1

Answer:

import java. util. Scanner;

public class ReverseString. {

public static void main(String[] args) {

System. out. println("Enter string to reverse:");

Scanner read = new Scanner(System. in); String str = read. nextLine();

String reverse = "";

{ reverse = reverse + str. charAt(i);

}

Explanation:

Answered by ABSuryashankar
1

Answer:

/ Java program to reverse order of vowels

class GFG {

// utility function to check for vowel

static boolean isVowel(char c) {

return (c == 'a' || c == 'A' || c == 'e'

|| c == 'E' || c == 'i' || c == 'I'

|| c == 'o' || c == 'O' || c == 'u'

|| c == 'U');

}

// Function to reverse order of vowels

static String reverseVowel(String str1) {

int j = 0;

Similar questions