import java.util.Scanner; public class BMI { public static void main(String[] arg) { Scanner sc = new Scanner(System.in); System.out.println("Enter a string"); String s=sc.nextLine(); for(int i=s.length()-1;i>=0;i--) System.out.print(s.charAt(i)); } }
Tutorials, tips and tricks about java programming language. Answers for many doubts about java programming language. Answering many howtos. Sample java projects and source code, java games, java programs for java practical labs.
Search This Blog
Showing posts with label display string in reverse order. Show all posts
Showing posts with label display string in reverse order. Show all posts
Java Program to Reverse a String
Here, we will see a java program to reverse a string. The string is read and is displayed in reverse order. Java program to display an input string in reverse order.
Subscribe to:
Posts (Atom)