AF
HomeTagSubmit NotesAsk AnythingLoginSubscribe Us
AF
1. Feel Free to ask and submit anything on Anyforum.in and get satisfactory answer
2. Registration is not compulsory, you can directly login via google or facebook
3. Our Experts are looking for yours ?.



corejava-programming: How to write the logic for the following series in java?

0 0 0 0 0 0
1 1 1 1 1
2 2 2 2
3 3 3
4 4
5

corejava x 353
programming x 168
Posted On : 2016-08-14 06:48:26.0
profile MOHAMMAD SALEEM BASHA - anyforum.in MOHAMMAD SALEEM BASHA
267150
up-rate
4
down-rate

Answers


public class Series {
public static void main(String[] args) {
int count=0;
while(count<6){
for(int i=6;i>count;i--){
System.out.print(count+" ");
}
System.out.println("");
count++;
}
}
}

Posted On : 2016-08-14 15:27:32
Satisfied : 1 Yes  0 No
profile Garima Gupta - anyforum.in Garima Gupta
596129026818
Reply This Thread
up-rate
5
down-rate

package com.blogspot.clickforjava;

public class PrintSeries {

public static void main(String args[]){
for(int i = 0; i < 6; i++){
for(int j = i; j < 6; j++)
System.out.print(i);
System.out.println();
}
}
}

=================================================
Output:
---------
000000
11111
2222
333
44
5

Posted On : 2016-08-18 23:24:10
Satisfied : 1 Yes  0 No
profile Amar - anyforum.in Amar
0520
Reply This Thread
up-rate
4
down-rate



Post Answer
Please Login First to Post Answer: Login login with facebook - anyforum.in