-
Notifications
You must be signed in to change notification settings - Fork 0
/
q9.js
45 lines (37 loc) · 743 Bytes
/
q9.js
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
37
38
39
40
41
42
43
44
45
/* Write a code to get the input in the given format and print the output in the given format.
Input Description:
A single line contains a string.
Output Description:
Print the characters in a string separated by line.
Sample Input :
guvigeek
Sample Output :
g
u
v
i
g
e
e
k */
//solution
// Getting input via STDIN
const readline = require("readline");
const inp = readline.createInterface({
input: process.stdin
});
const userInput = [];
inp.on("line", (data) => {
userInput.push(data);
});
inp.on("close", () => {
//start-here
//Your code goes here … replace the below line with your code logic
const arr=userInput[0].split("");
let i=0;
while(i<arr.length){
console.log(arr[i]);
i++;
}
//end-here
});