WAP that performs string reverse in java using the do-while loop.

import java.util.Scanner;
/*
* Prepared By : Rutu Shah
* This program performs string reverse using do-while loop.
* */
public class PrintReverseString {
    public static void main(String[] args) {
      String string;
        System.out.print("Enter a String : ");
        Scanner scanner = new Scanner(System.in);
        string = scanner.nextLine();
        int reverseString =string.length();
        System.out.print("Reverse of the String : ");
        do {
            System.out.print(string.charAt(reverseString-1));
            reverseString--;
        }while (reverseString>0);
    }
}

Output

Rutu Shah