Tuesday, October 5, 2021

 

1) Reverse each word in a string Input: hello world java   

  //Output: olleh dlrow avaj

String str="hello world java";

String[] tokens=str.split(" ");

for(int i=0;i<tokens.length;i++) {

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

System.out.print(tokens[i].charAt(j));

}

System.out.print(" ");

}

0 comments:

Post a Comment

selenium-repo by venu

Blog helps to a student or IT employee to develop or improve skills in Software Testing.
For Online Classes Email us: gadiparthi122@mail.com

Followers

About Me

My photo
Hyderabad, Andhra Pradesh, India
I am Automation Testing Professional. I have completed my graduation in B.Tech (Computers) from JNTU Hyderabad and started my career in Software Testing accidentally since then, I passionate on learning new technologies

Contact Form

Name

Email *

Message *

Popular Posts