Computer Science, asked by acsaleyamathews, 1 year ago

Write A program in java to reverse each word of a string without using library functions
For Eg: input: India
output: aidnI


acsaleyamathews: any one pls help... :)
acsaleyamathews: :(
acsaleyamathews: Any One pls...Its Urgent

Answers

Answered by ash97
3
class Reverse
{
Void main( String s)
{ String n="";
for(int i=0;i<s.length();i++)
{
char ch=s.charAt(i);
n=ch+n;
}
System.out.println("reversed string : "+n);
}
}

OUTPUT:
Ram <¬

reversed string : maR

AmyLeya: thanks
acsaleyamathews: Thanks
acsaleyamathews: if it is a long sentence can we use this same program
ash97: yes, sure.
acsaleyamathews: :)
ash97: if u want more info, plz go to javaforschool site.
acsaleyamathews: ok...I will have a look
Similar questions