public class Pattern {
public static void main(String[] args) {
for(int i=1;i<=5;i++){
System.out.println(" "+i);
}
for(int i=1;i<=10;i++){
System.out.print(i+" ");
}System.out.println();
for(int i=6;i<=10;i++){
System.out.println(" "+i);
}
}
}
OUTPUT:
1
2
3
4
1 2 3 4 5 6 7 8 9 10
6
7
8
9
10
public static void main(String[] args) {
for(int i=1;i<=5;i++){
System.out.println(" "+i);
}
for(int i=1;i<=10;i++){
System.out.print(i+" ");
}System.out.println();
for(int i=6;i<=10;i++){
System.out.println(" "+i);
}
}
}
OUTPUT:
1
2
3
4
1 2 3 4 5 6 7 8 9 10
6
7
8
9
10
No comments:
Post a Comment