1 2 3 4 5
6 7 8 9
10 11 12
13 14
15
Write the program to dispaly the following patterns.
Answers
Answered by
1
Answer:
the following program is in Java
Explanation:
class Pattern1
{
public static void main()
{
int i,j, k=15 ;
for( i=5 ; i>0; i--)
{
for( j=1; j<=i; j++)
{
System.out.print(k + "\t");
k-- ;
}
System.out.println();
}
}
}
Here i and j are loop control variables and k is a decrement operator.
hope it helps.
Similar questions