Just Displaying

0 abhishek phukan · January 10, 2015
How can i write a program to display a number of series like the following:

56789
6789
789
89
9


public class displaying {
 
 
   public static void main(String args[]){
       int x,y,z;
       for(x=0;x<5;x++){
         for(y=5;y<10;y++){
             z=x+y;
             System.out.println(z);
         }
       }
   }
}

i have write the program but its not giving the desired output.Something is missing.Please can anyone tell what condition i required for the completion of the above problem.
Thank You....

Post a Reply

Replies

Oldest  Newest  Rating
+1 Scott M · January 10, 2015
for(int x = 5; x != 10; x++) {
for(int y = x; y != 10; y++)
System.out.print(y);
System.out.println();
}

Hope that helps!
0 abhishek phukan · January 10, 2015
Thanx Scott..Keep helping
  • 1

Java / Android Development

107,085 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator