String result = "";
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= i; j++) {
result += "*";
}
result += "|";
}
System.out.println(result);What is printed?
- A
<strong>|</strong><em>|</em>***|
- B
<em><strong>|</strong>|</em>|
- C
<em>|</em>|*|
- Dcheck_circle
<em>|<strong>|</strong></em>|
Explanation
For i=1: one "<em>", then "|". For i=2: two "</em>", then "|". For i=3: three "<em>", then "|". Result: "</em>|<strong>|</strong>*|".