English

Write the output of the following program code. int r=0, c=0; for (r=9; r>=5; r--) { for(c=9; c>=r; c--) { System.out.print(" " + c); } System.out.println (); }

Advertisements
Advertisements

Question

Write the output of the following program code.

int r=0, c=0;
for (r=9; r>=5; r--)
{
    for(c=9; c>=r; c--)
    {
      System.out.print(" " + c);
    }
    System.out.println ();
}
Very Short Answer
Advertisements

Solution

9
9 8
9 8 7
9 8 7 6
9 8 7 6 5
shaalaa.com
  Is there an error in this question or solution?
Chapter 1: Revision of Class 9 Syllabus - Exercises [Page 49]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 1 Revision of Class 9 Syllabus
Exercises | Q 7. (iv) | Page 49
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×