answersLogoWhite

0

/* Input: Do Your Duty

* Output: Duty Your Do

*/

import java.io.*;

class RevSent

{

protected static void main()throws IOException

{

BufferedReader in=new BufferedReader(new InputStreamReader(System.in));

System.out.print("Enter the Sentence: ");

String s=in.readLine();

char ch; short a=0,b=0;

for(short i=0;i<s.length();i++)

{

ch=s.charAt(i);

if(ch==' ')

a++;

}

String w[]=new String[a+1];

for(short i=0;i<=a;i++)

w[i]="";

for(short i=0;i<s.length();i++)

{

ch=s.charAt(i);

if(ch==' ')

b++;

else

w[b]+=ch;

}

for(short i=a;i>=0;i--)

System.out.print(w[i]+" ");

}}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Can you write a thesis statement in any order?

No.


How can you generate a palindrome from a given number?

You write the number and then follow it with the digits in reverse order.


How long does a statement of purpose need to be in order to effectively convey my qualifications and goals for the program?

A statement of purpose should typically be around 500-1000 words in length to effectively convey your qualifications and goals for the program.


How do you program a reverse auto loan calculator in JAVA?

In order to program a reverse auto loan calculator in JAVA, you are going to need a lot of experience with JAVA. There are online tutorials that can help you set up with fundamentals of JAVA so that you will be able to create almost any basic program you want.


What is a silly way to remember the planets backwards?

Write the names in order on a piece of paper, then turn it upside down and you can read the names in reverse order.


What is a member of the Benedictine order called?

This is a statement you need to write a question


How do you write a program to read set of numbers using by an array and display the ascending order of the given input numbers?

To write a C++ program to display the student details using class and array of object.


Write a program which reads names of students and their telephones from a file and produce a linked list ordered in alphabetical order by the surname of the student?

write a program which reads names of students and their telephones from a file and produce a linked list ordered in alphabetical order by the surname of the student.


Write a c program for alphabetical order?

int main (void) { puts ("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); return 0; }


What is the order of processing?

first you find theise statement and summerize it then you write a paragraph on the process its alot to do so yeah i think this is right


Statement of polygon law of forces?

if several COPLANAR FORCES are acting at a point simultaneously such that each one of them can be represented in direction and magnitude by a side of a polygon, taken in order, then the resultant is given by the closing side in the reverse order


When you multiply or divide an inquality by a negative number you must reverse the sense of inequality why?

You must reverse the sense of inequality because, in essence, you're taking the opposite of both sides. In order to more properly show this, here's an example. 3&gt;2 Three is greater than two. True statement, right? Let's multiply both sides by -1 -3&gt;-2 The statement is no longer true. In order to keep the equation true, you must flip the inequality. As in -3&lt;-2 Now, the statement is true again.