हिंदी

Write the program to display the following pattern: 5 4 3 2 15 4 3 2 5 4 35 45 - Computer Applications

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 [पृष्ठ १४७]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
अध्याय 1.1 Nested Loop
EXERCISES | Q VI. 9. (h) | पृष्ठ १४७
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×
Our website is made possible by ad-free subscriptions or displaying online advertisements to our visitors.
If you don't like ads you can support us by buying an ad-free subscription or please consider supporting us by disabling your ad blocker. Thank you.