Computer Science, asked by TeknoVex, 1 year ago

Print the following pattern in Java:

54321
5432
543
54
5


noname18: plz follow me
noname18: is me kuch nahi jai ga
noname18: daya karo
noname18: _/\_
TeknoVex: i dont know hindi sorry
noname18: plz follow me
noname18: plz
TeknoVex: how to follow

Answers

Answered by Cutiepieeeswati
9
Hi guys


for( i = 1 ; i<=N; i + + )
{
for( j = N ; j >i ;/j - - )
{
print j value
}
print new line ;
}


hope it helps

Cutiepieeeswati: its wrong??
TeknoVex: the specific keywords are not found in the java language
TeknoVex: the print keyword is wrong
Cutiepieeeswati: Ok i am sorry friend
noname18: hi
TeknoVex: its ok
TeknoVex: whats up
noname18: cutepieeeswati plz follow me
noname18: plz
Cutiepieeeswati: why
Answered by stylishtamilachee
32

Answer:

public class Pattern

{

public static void display( )

{

int k = 5 ;

for ( int i = 5 ; i > = 0 ; i-- )

{

k = 5 ;

for ( int j = i ; j > 0 ; j-- )

{

System.out.print( k + " ") ;

k-- ;

}

System.out.println( ) ;

}

}

}

Nested Loop:

A loop inside body of another loop is called nested loop.

A nested loop is used when functioning of a loop is to be repeated a number of times.

For a value of outer loop's control variable, the inner loop completely repeats ; then the outer loop update its control variable's value and the inner loop repeat again for new value of outer loop's control value and so on.

Similar questions