Saturday, 24 January 2015

Print "welcome bangalore" as welcome erolagnab

import java.util.Scanner;


public class SB

{

public static void main(String[] args) {

{
String test="welcome bangalore";

String reverse="";


 int i=0;

 String a[]=test.split(" ");


 for (int j = a[1].length()-1; j >= 0; j--)
 {

reverse = reverse + a[1].charAt(j);
 }


 a[1]=reverse;
 test=a[0] +" "+ a[1];
 System.out.println(test);



}
}
}











No comments:

Post a Comment