PROGRAM TO REVERSE THE NAME INPUT BY USER.
WRITE A PROGRAM TO REVERSE THE NAME INPUT BY USER.
import java.util.Scanner;
class Rev_Name
{
public static void main()
{
String name;
System.out.println("Enter your name");
Scanner in = new Scanner(System.in);
name = in.nextLine();
int l= name.length()-1;
System.out.println("your name in reverse order");
while(l>-1)
{
System.out.print(name.charAt(l));
l--;
}
}
}
For Any Desired Program comment below. WE WILL TRY OUR BEST TO MAKE THAT PROGRAM AVAILABLE.
Comments
Post a Comment