Advertisements
Advertisements
प्रश्न
Write the program to display the following pattern:
5 4 3 2 1
5 4 3 2
5 4 3
5 4
5
संक्षेप में उत्तर
उत्तर
public class Q9h
{ public static void main(String ar[])
{ System.out Println("\n-----------------------");
int i, j;
for (i = 1; i <= 5; i++)
{System.out.println();
for (j = 5; >= i; j--)
System.out.print(j + " ");
}}
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.1: Nested Loop - EXERCISES [पृष्ठ १४७]