A String Display each character on separate line in Reverse order in JAVA.(accepts a string from users and display each character on separate line in reverse order in JAVA)
CODING:
import java.util.Scanner;
class ReString{
public static void main(String args[]){
Scanner s=new Scanner(System.in);
System.out.print("Enter your name:");
String name=s.next();
for(int i=name.length()-1;i>=0;i--)
System.out.println(name.charAt(i));
}
}
class ReString{
public static void main(String args[]){
Scanner s=new Scanner(System.in);
System.out.print("Enter your name:");
String name=s.next();
for(int i=name.length()-1;i>=0;i--)
System.out.println(name.charAt(i));
}
}
Comments
Post a Comment