S
Silver
Practice
My progress
Compiler
Sign in
Working…
Practice
›
Java Fundamentals
›
Module 2. Selection & Iteration
›
2.5 Nested loops and strings
Task
4
of
7
·
0
solved ·
7
to go
0%
1
2
3
4
5
6
7
You can read the problem, but answers are checked only for signed-in students.
Sign in to answer →
2.5 Iteration — print each character
Total: 0 / 4 pts
Practice mode — check each part and get hints as you go.
Task
Read a word and print each of its characters on its own line.
Input
cat
prints
c
,
a
,
t
.
Your solution
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String s = in.next(); // print each character of s on its own line } }
Next task →