Sunday, September 8, 2013

Reversing a sentence.

Problem: WAP reverse a given sentence word by word.

Sample Input       : India is in Asia.
Sample Output    : Asia in is India.
Algorithm:
  1. Reverse each word.
  2. After that Reverse Full sentence.
Source Code:

Junit Test case for above Program:

No comments:

Post a Comment