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... :)
Answers
Answered by
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
{
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
Similar questions
Computer Science,
9 months ago
Science,
9 months ago
Math,
1 year ago
Social Sciences,
1 year ago
Geography,
1 year ago