Create a program that when given a four word sentence as CMD arguments, it prints it backwards.
E.g the sentence “How are you Today”, will be printed as “Today you are How”.
Sample run 1: Sample run 2:
java lab02_task01 how are you today java lab02_task01 we are going home
Output: today you are how Output: home going are we
1
Expert's answer
2021-09-15T11:41:55-0400
public class Main {
public static void main(String[] args) {
if (args.length > 0) {
for (int i = args.length - 1; i >= 0; i--) {
System.out.print(args[i] + " ");
}
}
}
}
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment