Computer Science, asked by udaychanpa635, 6 months ago

1
2 3
4 5 6
7 8 9 10

write a program using while loop to display above output​

Answers

Answered by rosey25
10

Answer:

Answer:

\huge\pink{\boxed{\green{\mathfrak{\overbrace{\underbrace{\fcolorbox{Black}{aqua}{\underline{\pink{✯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 SwapnilMehta
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