How to print a pattern in Java.
class 10 ICSE
1
12
123
Answers
Answered by
1
class abc
{
Public void main ()
{
for(int x=1; x<=3;x++)
{
for(int y=1;y<=x; y++)
{
System.out.print(y) ;
}
System.out.println() ;
}}}
HOPE IT IS HELPFUL IF SO PLZ MARK AS BRAINLIEST.
{
Public void main ()
{
for(int x=1; x<=3;x++)
{
for(int y=1;y<=x; y++)
{
System.out.print(y) ;
}
System.out.println() ;
}}}
HOPE IT IS HELPFUL IF SO PLZ MARK AS BRAINLIEST.
Answered by
2
int r , c;
for (r = 1 ; r <=3 ; r++)
{
for ( c = 1 ; c <=r ; c++)
System.out.print(c);
System.out.println( );
}
I HAVE JUST WRITTEN THE LOGIC
HOPE IT HELPS U.......
THANKS...........
☆☆☆☆☆☆☆☆☆☆☆
for (r = 1 ; r <=3 ; r++)
{
for ( c = 1 ; c <=r ; c++)
System.out.print(c);
System.out.println( );
}
I HAVE JUST WRITTEN THE LOGIC
HOPE IT HELPS U.......
THANKS...........
☆☆☆☆☆☆☆☆☆☆☆
Anonymous:
the condition will allow only one to print
Similar questions