class ReverseOfString
{
public static void main(String args[])
{
char s[]=new char[]{'K','A','N','P','U','R'};
int a=s.length;
for(int i=a-1;i>=0;i--)
{
for(int j=5;j>=i;j--)
{
System.out.print(s[j]);
}
System.out.println(" ");
}
}
}
No comments:
Post a Comment