-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDay18_prob1.java
More file actions
36 lines (26 loc) · 845 Bytes
/
Day18_prob1.java
File metadata and controls
36 lines (26 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
write a program that creates integer array of n elements, accepts the values of arrays and print the array in reverse :
Input Format
Accepts n values from the user.
Constraints
All number should be integer values (Positive, negative and zero)
Output Format
It should first display original array and after reversing the array it should display the reverse array.
Sample Input 0
8 7 4 3
Sample Output 0
3 4 7 8
*/
// kirtan jain
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// String input = "";//get the input
String str[] = br.readLine().split(" ");
for(int i = str.length-1;i>=0;i--){
System.out.print(str[i] +" ");
}
}
}