Advertisements
Advertisements
Question
Predict the output:
int k = 5; j;
while (k >= 1)
{
j = 1
while (j <= k)
{
System.out.print(j);
j++
}
System.out.println();
k--;
}
Answer in Brief
Solution
12345
1234
123
12
1
shaalaa.com
Is there an error in this question or solution?