1
2 3
4 5 6
7 8 9 10
write a program using while loop to display above output
Answers
Answered by
10
Answer:
Answer:
One way is to write the printf statement 10 times. But that is definitely not a good choice if you have to write it 50 times! So, here comes the while loop. Now, let's understand each line of the code.
Answered by
1
Answer:
class pattern
{
public static void main (String args [])
{
int i,j;
int k=1;
for (i=1;i<=5;i++)
{
for (j=1;i<=i;j++)
{
System.out.print(k);
k++;
}
System.out.println();
}
}
}
Please Subscribe my Youtube Channel Study To Study ICSE-Swapnil Mehta for more Java Programs :)
Explanation:
Hope this help you
Please mark me as brainlist :)
Similar questions
Math,
3 months ago
Social Sciences,
3 months ago
Physics,
6 months ago
Math,
6 months ago
Science,
11 months ago