Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //concept to print the reverse
- //string through command line argument
- class PrintReverse{
- public static void main(String args[]){
- int num=0;
- System.out.println("Entered Sentence is::");
- for(int i=0;i<args.length;i++)
- {
- System.out.print(args[i] + " ");
- num++;
- }
- System.out.println("Reverse order of Entered sentence is ::");
- for(int j=num-1;j>=0;j--)
- {
- System.out.print(args[j] + " " );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment